- L'utente entra direttamente sul circuito, con fido a zero.

++Abilitazione Fido utente (per admin).
This commit is contained in:
Surya Paolo
2023-06-01 11:39:53 +02:00
parent 0945f1af08
commit a79e79a85e
19 changed files with 615 additions and 418 deletions

View File

@@ -364,7 +364,7 @@ router.post('/settable', authenticate, async (req, res) => {
} else if (params.table === 'hours') {
} else {
if ((mydata['_id'] === undefined || mydata['_id'] === '' || (mytablerec.isNew && mydata['_id'] === 0)) && (mytablerec._id === undefined)) {
if ((mydata['_id'] === undefined || mydata['_id'] === '' || (mytablerec.isNew && mydata['_id'] === 0)) && (mytablerec._id === undefined || mytablerec._id === '0')) {
mytablerec._id = new ObjectID();
mydata._id = new ObjectID();
}
@@ -1252,11 +1252,11 @@ router.post('/duprec/:table/:id', authenticate, async (req, res) => {
send({ code: server_constants.RIS_CODE_ERR_UNAUTHORIZED, msg: '' });
}
if (!User.isAdmin(req.user.perm) && !User.isManager(req.user.perm)) {
/* if (!User.isAdmin(req.user.perm) && !User.isManager(req.user.perm)) {
// If without permissions, exit
return res.status(404).
send({ code: server_constants.RIS_CODE_ERR_UNAUTHORIZED, msg: '' });
}
} */
return await mytable.findById(id).then(async (mydata) => {