refs #6085 aclMail back #1869
|
@ -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
|
|||||||
fields: ['roleId'],
|
fields: ['roleId'],
|
||||||
where: {principalId: userId}
|
where: {principalId: userId}
|
||||||
carlossa marked this conversation as resolved
Outdated
juan
commented
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
juan
commented
Un 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');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
myOptions no tiene utilidad