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",
"head_of_admin",
"admin",
"executive",
"accountant",
"branch_admin",
"branch_manager",
"branch_accountant",
"head_of_sale",
"sale",
];
function globalAllow(user: RequestWithUser["user"]) {
const allowList = ["system", "head_of_admin", "accountant", "head_of_sale"];
return allowList.some((v) => user.roles?.includes(v));
const listAllowed = ["system", "head_of_admin", "admin", "executive", "accountant"];
return user.roles?.some((v) => listAllowed.includes(v)) || false;
}
const permissionCheckCompany = createPermCheck((_) => true);