mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-12 15:33:20 -05:00
Fix for #2522.
This commit is contained in:
parent
652001ef7b
commit
36d9d13234
@ -2491,7 +2491,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
||||
if ((typeof command.consent == 'number') && (command.consent != group.consent)) { if (change != '') change += ' and consent changed'; else change += 'User group "' + group.name + '" consent changed'; group.consent = command.consent; }
|
||||
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, action: 'usergroupchange', links: group.links, 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, 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);
|
||||
}
|
||||
|
@ -2762,7 +2762,7 @@
|
||||
ugroup.name = message.event.name;
|
||||
if (message.event.desc) { ugroup.desc = message.event.desc; } else { delete ugroup.desc; }
|
||||
if (message.event.links) { ugroup.links = message.event.links; } else { delete ugroup.links; }
|
||||
if (message.event.consent) { ugroup.consent = message.event.consent; } else { delete ugroup.consent; }
|
||||
if (message.event.consent !== null) { ugroup.consent = message.event.consent; }
|
||||
}
|
||||
mainUpdate(4096 + 8192 + 16384);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user