From 5c7db2afc68604097d8eb1200823c2fca60fba52 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Thu, 3 Jul 2025 14:41:33 +0700 Subject: [PATCH] feat(perm): update api quotation perm --- src/controllers/05-quotation-controller.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/controllers/05-quotation-controller.ts b/src/controllers/05-quotation-controller.ts index 80a0b95..92e096c 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -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);