- L'utente entra direttamente sul circuito, con fido a zero.
++Abilitazione Fido utente (per admin).
This commit is contained in:
@@ -73,7 +73,7 @@ router.post('/load', authenticate, async (req, res) => {
|
||||
}
|
||||
|
||||
if (data) {
|
||||
data.account = await Account.getAccountByUsernameAndCircuitId(idapp, '', data._id, false, '', data.path);
|
||||
data.account = await Account.getAccountByUsernameAndCircuitId(idapp, '', data._id, false, false, '', data.path);
|
||||
}
|
||||
|
||||
const arrrecnotif = await SendNotif.findAllNotifByUsernameIdAndIdApp(req.user.username, lastdr, idapp);
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ router.post('/load', authenticate, async (req, res) => {
|
||||
for (let i = 0; i < data.mycircuits.length; i++) {
|
||||
const mycirc = await Circuit.findOne({ idapp, name: data.mycircuits[i].circuitname }).lean();
|
||||
if (mycirc)
|
||||
data.mycircuits[i].account = await Account.getAccountByUsernameAndCircuitId(idapp, '', mycirc._id, true, groupname);
|
||||
data.mycircuits[i].account = await Account.getAccountByUsernameAndCircuitId(idapp, '', mycirc._id, true, true, groupname);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ router.post('/load', authenticate, async (req, res) => {
|
||||
for (let i = 0; i < data.mycircuits.length; i++) {
|
||||
const mycirc = await Circuit.findOne({ idapp, name: data.mycircuits[i].circuitname }).lean();
|
||||
if (mycirc)
|
||||
data.mycircuits[i].account = await Account.getAccountByUsernameAndCircuitId(idapp, '', mycirc._id, true, groupname);
|
||||
data.mycircuits[i].account = await Account.getAccountByUsernameAndCircuitId(idapp, '', mycirc._id, true, true, groupname);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1311,6 +1311,10 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
|
||||
|
||||
await Circuit.SetDefMinMaxCollettivi(idapp, mydata.valmin, mydata.valmax);
|
||||
|
||||
} else if (mydata.dbop === 'AbilitaTuttiCircuiti') {
|
||||
|
||||
await Circuit.AbilitaTuttiCircuiti(idapp);
|
||||
|
||||
} else if (mydata.dbop === 'setstrProvByIdCityCircuits') {
|
||||
|
||||
await Circuit.setstrProvByIdCityCircuits(idapp);
|
||||
@@ -1440,7 +1444,7 @@ async function eseguiDbOpUser(idapp, mydata, locale, req, res) {
|
||||
|
||||
for (const mycirc of allcirc) {
|
||||
// Il Conto Comunitario prende il nome del circuito !
|
||||
await Account.createAccount(idapp, '', mycirc.name, '', mycirc.path);
|
||||
await Account.createAccount(idapp, '', mycirc.name, true, '', mycirc.path);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user