mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
First version with user groups enforcement.
This commit is contained in:
parent
96f5f2fb63
commit
8c0c17b844
4 changed files with 154 additions and 24 deletions
10
webserver.js
10
webserver.js
|
@ -1770,7 +1770,15 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
|||
const subscriptions = [userid, 'server-global'];
|
||||
if (user.siteadmin != null) {
|
||||
if (user.siteadmin == 0xFFFFFFFF) subscriptions.push('*');
|
||||
if ((user.siteadmin & 2) != 0) subscriptions.push('server-users');
|
||||
if ((user.siteadmin & 2) != 0) {
|
||||
if ((user.groups == null) || (user.groups.length == 0)) {
|
||||
// Subscribe to all user changes
|
||||
subscriptions.push('server-users');
|
||||
} else {
|
||||
// Subscribe to user changes for some groups
|
||||
for (var i in user.groups) { subscriptions.push('server-users:' + i); }
|
||||
}
|
||||
}
|
||||
}
|
||||
if (user.links != null) { for (var i in user.links) { subscriptions.push(i); } }
|
||||
obj.parent.RemoveAllEventDispatch(target);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue