feat(perm): update api quotation perm
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 5s

This commit is contained in:
Methapon2001 2025-07-03 14:41:33 +07:00
parent d6212e9ba4
commit 5c7db2afc6

View file

@ -150,15 +150,16 @@ const MANAGE_ROLES = [
"system", "system",
"head_of_admin", "head_of_admin",
"admin", "admin",
"executive",
"accountant", "accountant",
"branch_admin",
"branch_manager",
"branch_accountant", "branch_accountant",
"head_of_sale",
"sale",
]; ];
function globalAllow(user: RequestWithUser["user"]) { function globalAllow(user: RequestWithUser["user"]) {
const allowList = ["system", "head_of_admin", "accountant", "head_of_sale"]; const listAllowed = ["system", "head_of_admin", "admin", "executive", "accountant"];
return allowList.some((v) => user.roles?.includes(v)); return user.roles?.some((v) => listAllowed.includes(v)) || false;
} }
const permissionCheckCompany = createPermCheck((_) => true); const permissionCheckCompany = createPermCheck((_) => true);