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

Now need agent uninstall permission to delete a device, mesh edit permission to move a device between groups.

This commit is contained in:
Ylian Saint-Hilaire 2020-08-29 11:43:09 -07:00
parent 936d7aeb0e
commit dd70ec8a34
6 changed files with 33 additions and 25 deletions

View file

@ -3333,7 +3333,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
// Make sure that we have rights on both source and destination mesh
const targetMeshRights = parent.GetMeshRights(user, command.meshid);
if (((rights & MESHRIGHT_MANAGECOMPUTERS) == 0) || ((targetMeshRights & MESHRIGHT_MANAGECOMPUTERS) == 0)) {
if (((rights & MESHRIGHT_EDITMESH) == 0) || ((targetMeshRights & MESHRIGHT_EDITMESH) == 0)) {
if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'changeDeviceMesh', responseid: command.responseid, result: 'Permission denied' })); } catch (ex) { } }
return;
}
@ -3385,7 +3385,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
// Get the node and the rights for this node
parent.GetNodeWithRights(domain, user, command.nodeids[i], function (node, rights, visible) {
// Check we have the rights to delete this device
if ((rights & MESHRIGHT_MANAGECOMPUTERS) == 0) return;
if ((rights & MESHRIGHT_UNINSTALL) == 0) return;
// Delete this node including network interface information, events and timeline
db.Remove(node._id); // Remove node with that id