mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Access permission and CIRA improvements.
This commit is contained in:
parent
7f6945c172
commit
ca94c192ac
29 changed files with 242 additions and 62 deletions
16
webserver.js
16
webserver.js
|
@ -537,6 +537,22 @@ module.exports.CreateWebServer = function (parent, db, args, secret, certificate
|
|||
obj.authenticate(user.name, req.body.apassword1, domain, function (err, userid) {
|
||||
var user = obj.users[userid];
|
||||
if (user) {
|
||||
// Remove all the mesh links to this user
|
||||
if (user.links != null) {
|
||||
for (var meshid in user.links) {
|
||||
// Get the mesh
|
||||
var mesh = obj.meshes[meshid];
|
||||
if (mesh) {
|
||||
// Remove user from the mesh
|
||||
if (mesh.links[userid] != null) { delete mesh.links[userid]; obj.db.Set(mesh); }
|
||||
// Notify mesh change
|
||||
var change = 'Removed user ' + user.name + ' from mesh ' + mesh.name;
|
||||
obj.parent.DispatchEvent(['*', mesh._id, user._id, userid], obj, { etype: 'mesh', username: user.name, userid: userid, meshid: mesh._id, name: mesh.name, mtype: mesh.mtype, desc: mesh.desc, action: 'meshchange', links: mesh.links, msg: change, domain: domain.id })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove the user
|
||||
obj.db.Remove(user._id);
|
||||
delete obj.users[user._id];
|
||||
req.session.destroy(function () { res.redirect(domain.url); });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue