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

More work on user device permissions.

This commit is contained in:
Ylian Saint-Hilaire 2020-03-29 13:40:48 -07:00
parent a61acc4890
commit 16288e49c5
3 changed files with 1205 additions and 1070 deletions

View file

@ -2502,8 +2502,8 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
db.SetUser(newuser);
// Notify user change
var targets = ['*', 'server-users', newuserid._id];
var event = { etype: 'user', userid: newuserid._id, username: newuserid.name, action: 'accountchange', msg: (command.rights == 0) ? ('Removed user device rights for ' + user.name) : ('Changed user device rights for ' + user.name), domain: domain.id, account: parent.CloneSafeUser(newuser) };
var targets = ['*', 'server-users', newuserid];
var event = { etype: 'user', userid: user._id, username: user.name, action: 'accountchange', msg: (command.rights == 0) ? ('Removed user device rights for ' + newuser.name) : ('Changed user device rights for ' + newuser.name), domain: domain.id, account: parent.CloneSafeUser(newuser) };
if (db.changeStream) { event.noact = 1; } // If DB change stream is active, don't use this event to change the user. Another event will come.
parent.parent.DispatchEvent(targets, obj, event);
}