mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
First version with user groups enabled.
This commit is contained in:
parent
13cf8c12eb
commit
1134dd2f7c
3 changed files with 34 additions and 21 deletions
13
webserver.js
13
webserver.js
|
@ -4079,6 +4079,19 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
|||
return false;
|
||||
}
|
||||
|
||||
// Returns a list of displatch targets for a given mesh
|
||||
// We have to target the meshid and all user groups for this mesh, plus any added targets
|
||||
obj.CreateMeshDispatchTargets = function (mesh, addedTargets) {
|
||||
var targets = (addedTargets != null) ? addedTargets : [];
|
||||
if (targets.indexOf('*') == -1) { targets.push('*'); }
|
||||
if (typeof mesh == 'string') { mesh = obj.meshes[mesh]; }
|
||||
if (mesh != null) {
|
||||
targets.push(mesh._id);
|
||||
for (var i in mesh.links) { if (i.startsWith('ugrp/')) { targets.push(i); } }
|
||||
}
|
||||
return targets;
|
||||
}
|
||||
|
||||
// Clone a safe version of a user object, remove everything that is secret.
|
||||
obj.CloneSafeUser = function (user) {
|
||||
if (typeof user != 'object') { return user; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue