1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Fixed and improved server file storage

This commit is contained in:
Ylian Saint-Hilaire 2018-06-19 12:25:57 -07:00
parent 2850340a7d
commit c6c9d90066
7 changed files with 40 additions and 15 deletions

View file

@ -37,6 +37,8 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain) {
} else if (splitid[0] == 'mesh') {
// Check mesh access
var meshrights = user.links[meshpath[0]];
if (meshrights == null) return null; // No meth rights for this user
meshrights = meshrights.rights; // Get the rights bit mask
if ((meshrights == null) || ((meshrights & 32) == 0)) return null; // This user must have mesh rights to "server files"
} else return null;
var rootfolder = meshpath[0], rootfoldersplit = rootfolder.split('/'), domainx = 'domain';
@ -1283,7 +1285,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain) {
var mesh = obj.parent.meshes[i];
if (mesh) {
var meshsplit = mesh._id.split('/');
files.filetree.f[mesh._id] = { t: 1, n: mesh.name, f: {} };
files.filetree.f[mesh._id] = { t: 4, n: mesh.name, f: {} };
files.filetree.f[mesh._id].maxbytes = obj.parent.getQuota(mesh._id, domain);
// Read all files recursively