Circuit go on...
This commit is contained in:
@@ -711,6 +711,34 @@ router.post('/groups/cmd', authenticate, (req, res) => {
|
||||
|
||||
});
|
||||
|
||||
router.post('/circuits/cmd', authenticate, (req, res) => {
|
||||
const usernameLogged = req.user.username;
|
||||
const idapp = req.body.idapp;
|
||||
const locale = req.body.locale;
|
||||
const usernameOrig = req.body.usernameOrig;
|
||||
const name = req.body.name;
|
||||
const cmd = req.body.cmd;
|
||||
const value = req.body.value;
|
||||
|
||||
/*if (!User.isAdmin(req.user.perm) || !User.isManager(req.user.perm)) {
|
||||
// If without permissions, exit
|
||||
if (usernameOrig !== usernameLogged) {
|
||||
return res.status(404).
|
||||
send({code: server_constants.RIS_CODE_ERR_UNAUTHORIZED, msg: ''});
|
||||
}
|
||||
}*/
|
||||
|
||||
return User.setCircuitCmd(idapp, usernameOrig, name, cmd, value, usernameLogged).
|
||||
then((ris) => {
|
||||
res.send(ris);
|
||||
}).
|
||||
catch((e) => {
|
||||
tools.mylog('ERRORE IN groups/cmd: ' + e.message);
|
||||
res.status(400).send();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
async function eseguiDbOp(idapp, mydata, locale) {
|
||||
|
||||
let ris = await User.DbOp(idapp, mydata);
|
||||
|
||||
Reference in New Issue
Block a user