refs #6085 aclMail back #1869

Merged
carlossa merged 16 commits from 6085-ACLsMail into dev 2024-01-03 07:56:11 +00:00
1 changed files with 2 additions and 6 deletions
Showing only changes of commit 53ff8784ff - Show all commits

View File

@ -24,14 +24,10 @@ module.exports = Self => {
const userId = ctx.options.accessToken.userId; const userId = ctx.options.accessToken.userId;
const models = Self.app.models; const models = Self.app.models;
const myOptions = {};
Object.assign(myOptions);
const roles = await models.RoleMapping.find({ const roles = await models.RoleMapping.find({
carlossa marked this conversation as resolved
Review

myOptions no tiene utilidad

myOptions no tiene utilidad
fields: ['roleId'], fields: ['roleId'],
where: {principalId: userId} where: {principalId: userId}
carlossa marked this conversation as resolved Outdated
Outdated
Review

options no esta definida en ningún sitio

options no esta definida en ningún sitio
}, myOptions); });
const availableMailAlias = await models.MailAliasAcl.find({ const availableMailAlias = await models.MailAliasAcl.find({
carlossa marked this conversation as resolved Outdated
Outdated
Review

Un findOne sería mes adequat. I faría la inversa, primer traure els registres de MailAliasAcl i despres comprobar si el usuari te algún dells en findOne

Un `findOne` sería mes adequat. I faría la inversa, primer traure els registres de MailAliasAcl i despres comprobar si el usuari te algún dells en findOne
fields: ['mailAliasFk'], fields: ['mailAliasFk'],
@ -42,7 +38,7 @@ module.exports = Self => {
}, },
mailAliasFk mailAliasFk
} }
}, myOptions); });
if (!availableMailAlias.length) throw new UserError('The alias cant be modified'); if (!availableMailAlias.length) throw new UserError('The alias cant be modified');
} }