mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
gui plugin updates partial
This commit is contained in:
parent
a98340cdc7
commit
f1ea4ae1b8
6 changed files with 242 additions and 3 deletions
19
meshuser.js
19
meshuser.js
|
@ -3102,6 +3102,25 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
|||
}
|
||||
break;
|
||||
}
|
||||
case 'plugins': {
|
||||
if ((user.siteadmin & 0xFFFFFFFF) == 0 || parent.parent.pluginHandler == null) break; // must be full admin, plugins enabled
|
||||
parent.db.getPlugins(function(err, docs) {
|
||||
try { ws.send(JSON.stringify({ action: 'updatePluginList', list: docs, result: err })); } catch (ex) { }
|
||||
});
|
||||
break;
|
||||
}
|
||||
case 'addplugin': {
|
||||
// @Ylianst - Do we need a new permission here?
|
||||
if ((user.siteadmin & 0xFFFFFFFF) == 0 || parent.parent.pluginHandler == null) break; // must be full admin, plugins enabled
|
||||
parent.parent.pluginHandler.addPlugin(command.url);
|
||||
break;
|
||||
}
|
||||
case 'removeplugin': {
|
||||
// @Ylianst - Do we need a new permission here?
|
||||
if ((user.siteadmin & 0xFFFFFFFF) == 0 || parent.parent.pluginHandler == null) break; // must be full admin, plugins enabled
|
||||
parent.parent.pluginHandler.removePlugin(command.id);
|
||||
break;
|
||||
}
|
||||
case 'plugin': {
|
||||
if (parent.parent.pluginHandler == null) break; // If the plugin's are not supported, reject this command.
|
||||
command.userid = user._id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue