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

Started work on user group permission removal, #3129

This commit is contained in:
Ylian Saint-Hilaire 2021-09-14 17:27:39 -07:00
parent 453eb369ee
commit 68dfafa739
3 changed files with 79 additions and 8 deletions

View file

@ -1948,12 +1948,17 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
if ((command.flags != null) && (typeof command.flags == 'number')) {
// Flags: 2 = Session Recording
if ((command.flags == 0) && (group.flags != null)) { delete group.flags; } else { if (command.flags !== group.flags) { group.flags = command.flags; } }
if (change == '') { change = 'User group flags changed.'; }
if (change == '') { change = 'User group features changed.'; }
}
if ((command.removeRights != null) && (typeof command.removeRights == 'number')) {
if ((command.removeRights == 0) && (group.removeRights != null)) { delete group.removeRights; } else { if (command.removeRights !== group.removeRights) { group.removeRights = command.removeRights; } }
if (change == '') { change = 'User group features changed.'; }
}
if (change != '') {
db.Set(group);
var event = { etype: 'ugrp', userid: user._id, username: user.name, ugrpid: group._id, name: group.name, desc: group.desc, consent: ((group.consent == null) ? 0 : group.consent), action: 'usergroupchange', links: group.links, flags: group.flags, msg: change, domain: domain.id };
var event = { etype: 'ugrp', userid: user._id, username: user.name, ugrpid: group._id, name: group.name, desc: group.desc, consent: ((group.consent == null) ? 0 : group.consent), action: 'usergroupchange', links: group.links, flags: group.flags, removeRights: group.removeRights, msg: change, domain: domain.id };
if (db.changeStream) { event.noact = 1; } // If DB change stream is active, don't use this event to change the mesh. Another event will come.
parent.parent.DispatchEvent(['*', group._id, user._id], obj, event);
}