- Sistemato i Referenti (e non Editori), quando crei un nuovo Catalogo ti imposta la proprietà a te, ma chiunque Collaboratore potrebbe cmq modificartelo.
This commit is contained in:
@@ -51,9 +51,10 @@ router.get('/id/:id', async function (req, res) {
|
||||
router.post('/addnew', authenticate, async function (req, res, next) {
|
||||
const idapp = req.body.idapp;
|
||||
const data = req.body.newCatalog;
|
||||
const username = req.user.username;
|
||||
|
||||
try {
|
||||
const newrecs = await globalTables.addNewCatalog(idapp, data);
|
||||
const newrecs = await globalTables.addNewCatalog(idapp, data, username);
|
||||
if (newrecs) {
|
||||
return res.send({ code: server_constants.RIS_CODE_OK, data: newrecs });
|
||||
} else {
|
||||
|
||||
@@ -721,6 +721,16 @@ router.post('/getobj', authenticate_noerror, async (req, res) => {
|
||||
)
|
||||
.sort({ username: 1 })
|
||||
.lean();
|
||||
} else if (cmd === 'lista_referenti') {
|
||||
ris = await User.find(
|
||||
{
|
||||
idapp,
|
||||
perm: { $bitsAnySet: 0b110010000 },
|
||||
},
|
||||
{ username: 1, name: 1, surname: 1 }
|
||||
)
|
||||
.sort({ username: 1 })
|
||||
.lean();
|
||||
}
|
||||
|
||||
// Invia la risposta
|
||||
|
||||
Reference in New Issue
Block a user