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

Improved uicustomevent security and events, #3823

This commit is contained in:
Ylian Saint-Hilaire 2022-03-30 07:14:14 -07:00
parent 3e0b76d423
commit 5a81c84d67
3 changed files with 43 additions and 9 deletions

View file

@ -7158,6 +7158,18 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
return rights;
}
// Return the node and rights for a array of nodeids
obj.GetNodesWithRights = function (domain, user, nodeids, func) {
var rc = nodeids.length, r = {};
for (var i in nodeids) {
obj.GetNodeWithRights(domain, user, nodeids[i], function (node, rights, visible) {
if ((node != null) && (visible == true)) { r[node._id] = { node: node, rights: rights }; if (--rc == 0) { func(r); } }
});
}
}
// Return the node and rights for a given nodeid
obj.GetNodeWithRights = function (domain, user, nodeid, func) {
// Perform user pre-validation