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

Added support for accounts that manage all device group

This commit is contained in:
Ylian Saint-Hilaire 2020-02-17 13:01:13 -08:00
parent 2cb3df77c5
commit 916e20fa9f
8 changed files with 45 additions and 7 deletions

View file

@ -370,7 +370,11 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
try { ws.send(JSON.stringify({ action: 'serverinfo', serverinfo: serverinfo })); } catch (ex) { }
// Send user information to web socket, this is the first thing we send
try { ws.send(JSON.stringify({ action: 'userinfo', userinfo: parent.CloneSafeUser(parent.users[user._id]) })); } catch (ex) { }
try {
var xuserinfo = parent.CloneSafeUser(parent.users[user._id]);
if ((user.siteadmin == 0xFFFFFFFF) && (parent.parent.config.settings.managealldevicegroups.indexOf(user._id) >= 0)) { xuserinfo.manageAllDeviceGroups = true; }
ws.send(JSON.stringify({ action: 'userinfo', userinfo: xuserinfo }));
} catch (ex) { }
if (user.siteadmin == 0xFFFFFFFF) {
// Send server tracing information