mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Pass through user info, plugin dev's can handle their own permissions.
This commit is contained in:
parent
ed701dff39
commit
3567330799
2 changed files with 6 additions and 6 deletions
|
@ -383,22 +383,22 @@ module.exports.pluginHandler = function (parent) {
|
|||
});
|
||||
};
|
||||
|
||||
obj.handleAdminReq = function (req, res, serv) {
|
||||
obj.handleAdminReq = function (req, res, user, serv) {
|
||||
var path = obj.path.join(obj.pluginPath, req.query.pin, 'views');
|
||||
serv.app.set('views', path);
|
||||
if (obj.plugins[req.query.pin] != null && typeof obj.plugins[req.query.pin].handleAdminReq == 'function') {
|
||||
obj.plugins[req.query.pin].handleAdminReq(req, res);
|
||||
obj.plugins[req.query.pin].handleAdminReq(req, res, user);
|
||||
}
|
||||
else {
|
||||
res.sendStatus(401);
|
||||
}
|
||||
}
|
||||
|
||||
obj.handleAdminPostReq = function(req, res, serv) {
|
||||
obj.handleAdminPostReq = function(req, res, user, serv) {
|
||||
var path = obj.path.join(obj.pluginPath, req.query.pin, 'views');
|
||||
serv.app.set('views', path);
|
||||
if (obj.plugins[req.query.pin] != null && typeof obj.plugins[req.query.pin].handleAdminPostReq == 'function') {
|
||||
obj.plugins[req.query.pin].handleAdminPostReq(req, res);
|
||||
obj.plugins[req.query.pin].handleAdminPostReq(req, res, user);
|
||||
}
|
||||
else {
|
||||
res.sendStatus(401);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue