refactor: adjust function
This commit is contained in:
parent
6baf79d76d
commit
597c107420
1 changed files with 3 additions and 4 deletions
|
|
@ -166,10 +166,9 @@ const MANAGE_ROLES = [
|
|||
"account",
|
||||
];
|
||||
|
||||
function globalAllow(roles?: string[]) {
|
||||
return ["system", "head_of_admin", "admin", "branch_manager", "head_of_account"].some((v) =>
|
||||
roles?.includes(v),
|
||||
);
|
||||
function globalAllow(user: RequestWithUser["user"]) {
|
||||
const allowList = ["system", "head_of_admin", "admin", "branch_manager", "head_of_account"];
|
||||
return allowList.some((v) => user.roles?.includes(v));
|
||||
}
|
||||
|
||||
@Route("/api/v1/quotation")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue