feat: allow anybody to edit customer data if can manage
This commit is contained in:
parent
86085a74ba
commit
842d81026e
8 changed files with 8 additions and 8 deletions
|
|
@ -31,7 +31,7 @@ const MANAGE_ROLES = [
|
|||
];
|
||||
|
||||
function globalAllow(user: RequestWithUser["user"]) {
|
||||
const listAllowed = ["system", "head_of_admin", "admin", "executive", "accountant"];
|
||||
const listAllowed = MANAGE_ROLES;
|
||||
return user.roles?.some((v) => listAllowed.includes(v)) || false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ const MANAGE_ROLES = [
|
|||
];
|
||||
|
||||
function globalAllow(user: RequestWithUser["user"]) {
|
||||
const listAllowed = ["system", "head_of_admin", "admin", "executive", "accountant"];
|
||||
const listAllowed = MANAGE_ROLES;
|
||||
return user.roles?.some((v) => listAllowed.includes(v)) || false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ const MANAGE_ROLES = [
|
|||
];
|
||||
|
||||
function globalAllow(user: RequestWithUser["user"]) {
|
||||
const listAllowed = ["system", "head_of_admin", "admin", "executive", "accountant"];
|
||||
const listAllowed = MANAGE_ROLES;
|
||||
return user.roles?.some((v) => listAllowed.includes(v)) || false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ const MANAGE_ROLES = [
|
|||
];
|
||||
|
||||
function globalAllow(user: RequestWithUser["user"]) {
|
||||
const listAllowed = ["system", "head_of_admin", "admin", "executive", "accountant"];
|
||||
const listAllowed = MANAGE_ROLES;
|
||||
return user.roles?.some((v) => listAllowed.includes(v)) || false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ const MANAGE_ROLES = [
|
|||
];
|
||||
|
||||
function globalAllow(user: RequestWithUser["user"]) {
|
||||
const listAllowed = ["system", "head_of_admin", "admin", "executive", "accountant"];
|
||||
const listAllowed = MANAGE_ROLES;
|
||||
return user.roles?.some((v) => listAllowed.includes(v)) || false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ const MANAGE_ROLES = [
|
|||
];
|
||||
|
||||
function globalAllow(user: RequestWithUser["user"]) {
|
||||
const listAllowed = ["system", "head_of_admin", "admin", "executive", "accountant"];
|
||||
const listAllowed = MANAGE_ROLES;
|
||||
return user.roles?.some((v) => listAllowed.includes(v)) || false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ const MANAGE_ROLES = [
|
|||
];
|
||||
|
||||
function globalAllow(user: RequestWithUser["user"]) {
|
||||
const listAllowed = ["system", "head_of_admin", "admin", "executive", "accountant"];
|
||||
const listAllowed = MANAGE_ROLES;
|
||||
return user.roles?.some((v) => listAllowed.includes(v)) || false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ const MANAGE_ROLES = [
|
|||
];
|
||||
|
||||
function globalAllow(user: RequestWithUser["user"]) {
|
||||
const listAllowed = ["system", "head_of_admin", "admin", "executive", "accountant"];
|
||||
const listAllowed = MANAGE_ROLES;
|
||||
return user.roles?.some((v) => listAllowed.includes(v)) || false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue