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",
|
"account",
|
||||||
];
|
];
|
||||||
|
|
||||||
function globalAllow(roles?: string[]) {
|
function globalAllow(user: RequestWithUser["user"]) {
|
||||||
return ["system", "head_of_admin", "admin", "branch_manager", "head_of_account"].some((v) =>
|
const allowList = ["system", "head_of_admin", "admin", "branch_manager", "head_of_account"];
|
||||||
roles?.includes(v),
|
return allowList.some((v) => user.roles?.includes(v));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Route("/api/v1/quotation")
|
@Route("/api/v1/quotation")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue