acl fixed
This commit is contained in:
parent
46a62854d6
commit
9405e49c8a
|
@ -41,10 +41,10 @@ module.exports = Self => {
|
||||||
|
|
||||||
if (!Object.keys(data).length) return;
|
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}});
|
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`);
|
throw new UserError(`You don't have enough privileges to do that`);
|
||||||
|
|
||||||
return client.updateAttributes(data);
|
return client.updateAttributes(data);
|
||||||
|
|
Loading…
Reference in New Issue