feat(perm): update api branch perm
This commit is contained in:
parent
15381c089c
commit
425e99bfde
2 changed files with 24 additions and 11 deletions
|
|
@ -20,10 +20,19 @@ import { RequestWithUser } from "../interfaces/user";
|
|||
import { branchRelationPermInclude, createPermCheck } from "../services/permission";
|
||||
import { queryOrNot, whereDateQuery } from "../utils/relation";
|
||||
|
||||
const MANAGE_ROLES = ["system", "head_of_admin", "admin", "branch_manager"];
|
||||
const MANAGE_ROLES = [
|
||||
"system",
|
||||
"head_of_admin",
|
||||
"admin",
|
||||
"executive",
|
||||
"accountant",
|
||||
"branch_admin",
|
||||
"branch_manager",
|
||||
"branch_accountant",
|
||||
];
|
||||
|
||||
function globalAllow(user: RequestWithUser["user"]) {
|
||||
const listAllowed = ["system", "head_of_admin", "admin"];
|
||||
const listAllowed = ["system", "head_of_admin", "admin", "executive", "accountant"];
|
||||
return user.roles?.some((v) => listAllowed.includes(v)) || false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue