acl fixed

This commit is contained in:
gerard 2018-09-27 12:58:19 +02:00
parent 46a62854d6
commit 9405e49c8a
1 changed files with 2 additions and 2 deletions

View File

@ -41,10 +41,10 @@ module.exports = Self => {
if (!Object.keys(data).length) return;
let isAdministrative = await Self.app.models.Account.hasRole(userId, 'administrative');
let isSalesAssistant = await Self.app.models.Account.hasRole(userId, 'salesAssistant');
let client = await Self.app.models.Client.findOne({where: {id: id}});
if (!isAdministrative && client.isTaxDataChecked)
if (!isSalesAssistant)
throw new UserError(`You don't have enough privileges to do that`);
return client.updateAttributes(data);