diff --git a/src/controllers/01-branch-controller.ts b/src/controllers/01-branch-controller.ts index 0f7de6e..8b82601 100644 --- a/src/controllers/01-branch-controller.ts +++ b/src/controllers/01-branch-controller.ts @@ -53,7 +53,7 @@ function globalAllow(user: RequestWithUser["user"]) { } function globalAllowView(user: RequestWithUser["user"]) { - return MANAGE_ROLES.concat("head_of_account", "head_of_sale").some((v) => + return MANAGE_ROLES.concat("head_of_accountant", "head_of_sale").some((v) => user.roles?.includes(v), ); } diff --git a/src/controllers/03-customer-branch-citizen-controller.ts b/src/controllers/03-customer-branch-citizen-controller.ts index dfc6e8d..75110c3 100644 --- a/src/controllers/03-customer-branch-citizen-controller.ts +++ b/src/controllers/03-customer-branch-citizen-controller.ts @@ -23,14 +23,14 @@ const MANAGE_ROLES = [ "system", "head_of_admin", "admin", - "head_of_account", - "account", + "head_of_accountant", + "accountant", "head_of_sale", "sale", ]; function globalAllow(user: RequestWithUser["user"]) { - const allowList = ["system", "head_of_admin", "admin", "head_of_account", "head_of_sale"]; + const allowList = ["system", "head_of_admin", "admin", "head_of_accountant", "head_of_sale"]; return allowList.some((v) => user.roles?.includes(v)); } diff --git a/src/controllers/03-customer-branch-controller.ts b/src/controllers/03-customer-branch-controller.ts index 66b4e12..d830ba3 100644 --- a/src/controllers/03-customer-branch-controller.ts +++ b/src/controllers/03-customer-branch-controller.ts @@ -45,14 +45,14 @@ const MANAGE_ROLES = [ "system", "head_of_admin", "admin", - "head_of_account", - "account", + "head_of_accountant", + "accountant", "head_of_sale", "sale", ]; function globalAllow(user: RequestWithUser["user"]) { - const allowList = ["system", "head_of_admin", "head_of_account", "head_of_sale"]; + const allowList = ["system", "head_of_admin", "head_of_accountant", "head_of_sale"]; return allowList.some((v) => user.roles?.includes(v)); } diff --git a/src/controllers/03-customer-controller.ts b/src/controllers/03-customer-controller.ts index 0013421..2a1aab2 100644 --- a/src/controllers/03-customer-controller.ts +++ b/src/controllers/03-customer-controller.ts @@ -41,14 +41,14 @@ const MANAGE_ROLES = [ "system", "head_of_admin", "admin", - "head_of_account", - "account", + "head_of_accountant", + "accountant", "head_of_sale", "sale", ]; function globalAllow(user: RequestWithUser["user"]) { - const allowList = ["system", "head_of_admin", "head_of_account", "head_of_sale"]; + const allowList = ["system", "head_of_admin", "head_of_accountant", "head_of_sale"]; return allowList.some((v) => user.roles?.includes(v)); } diff --git a/src/controllers/03-employee-checkup-controller.ts b/src/controllers/03-employee-checkup-controller.ts index 3c1b4d7..a72ad2d 100644 --- a/src/controllers/03-employee-checkup-controller.ts +++ b/src/controllers/03-employee-checkup-controller.ts @@ -23,13 +23,13 @@ const MANAGE_ROLES = [ "system", "head_of_admin", "admin", - "head_of_account", - "account", + "head_of_accountant", + "accountant", "head_of_sale", ]; function globalAllow(user: RequestWithUser["user"]) { - const allowList = ["system", "head_of_admin", "head_of_account", "head_of_sale"]; + const allowList = ["system", "head_of_admin", "head_of_accountant", "head_of_sale"]; return allowList.some((v) => user.roles?.includes(v)); } diff --git a/src/controllers/03-employee-controller.ts b/src/controllers/03-employee-controller.ts index 0f1fb73..74886f2 100644 --- a/src/controllers/03-employee-controller.ts +++ b/src/controllers/03-employee-controller.ts @@ -50,13 +50,13 @@ const MANAGE_ROLES = [ "system", "head_of_admin", "admin", - "head_of_account", - "account", + "head_of_accountant", + "accountant", "head_of_sale", ]; function globalAllow(user: RequestWithUser["user"]) { - const allowList = ["system", "head_of_admin", "head_of_account", "head_of_sale"]; + const allowList = ["system", "head_of_admin", "head_of_accountant", "head_of_sale"]; return allowList.some((v) => user.roles?.includes(v)); } diff --git a/src/controllers/03-employee-other-info-controller.ts b/src/controllers/03-employee-other-info-controller.ts index 7d88635..d6b73e7 100644 --- a/src/controllers/03-employee-other-info-controller.ts +++ b/src/controllers/03-employee-other-info-controller.ts @@ -23,13 +23,13 @@ const MANAGE_ROLES = [ "system", "head_of_admin", "admin", - "head_of_account", - "account", + "head_of_accountant", + "accountant", "head_of_sale", ]; function globalAllow(user: RequestWithUser["user"]) { - const allowList = ["system", "head_of_admin", "head_of_account", "head_of_sale"]; + const allowList = ["system", "head_of_admin", "head_of_accountant", "head_of_sale"]; return allowList.some((v) => user.roles?.includes(v)); } diff --git a/src/controllers/03-employee-passport-controller.ts b/src/controllers/03-employee-passport-controller.ts index b8b0721..8f8c253 100644 --- a/src/controllers/03-employee-passport-controller.ts +++ b/src/controllers/03-employee-passport-controller.ts @@ -22,13 +22,13 @@ const MANAGE_ROLES = [ "system", "head_of_admin", "admin", - "head_of_account", - "account", + "head_of_accountant", + "accountant", "head_of_sale", ]; function globalAllow(user: RequestWithUser["user"]) { - const allowList = ["system", "head_of_admin", "head_of_account", "head_of_sale"]; + const allowList = ["system", "head_of_admin", "head_of_accountant", "head_of_sale"]; return allowList.some((v) => user.roles?.includes(v)); } diff --git a/src/controllers/03-employee-visa-controller.ts b/src/controllers/03-employee-visa-controller.ts index 038321f..b1fe09d 100644 --- a/src/controllers/03-employee-visa-controller.ts +++ b/src/controllers/03-employee-visa-controller.ts @@ -22,13 +22,13 @@ const MANAGE_ROLES = [ "system", "head_of_admin", "admin", - "head_of_account", - "account", + "head_of_accountant", + "accountant", "head_of_sale", ]; function globalAllow(user: RequestWithUser["user"]) { - const allowList = ["system", "head_of_admin", "head_of_account", "head_of_sale"]; + const allowList = ["system", "head_of_admin", "head_of_accountant", "head_of_sale"]; return allowList.some((v) => user.roles?.includes(v)); } diff --git a/src/controllers/03-employee-work-controller.ts b/src/controllers/03-employee-work-controller.ts index 062a8f8..3704546 100644 --- a/src/controllers/03-employee-work-controller.ts +++ b/src/controllers/03-employee-work-controller.ts @@ -22,13 +22,13 @@ const MANAGE_ROLES = [ "system", "head_of_admin", "admin", - "head_of_account", - "account", + "head_of_accountant", + "accountant", "head_of_sale", ]; function globalAllow(user: RequestWithUser["user"]) { - const allowList = ["system", "head_of_admin", "head_of_account", "head_of_sale"]; + const allowList = ["system", "head_of_admin", "head_of_accountant", "head_of_sale"]; return allowList.some((v) => user.roles?.includes(v)); } diff --git a/src/controllers/04-invoice-controller.ts b/src/controllers/04-invoice-controller.ts index 28864cf..b4ebea3 100644 --- a/src/controllers/04-invoice-controller.ts +++ b/src/controllers/04-invoice-controller.ts @@ -27,10 +27,10 @@ type InvoicePayload = { installmentNo: number[]; }; -const MANAGE_ROLES = ["system", "head_of_admin", "admin", "head_of_account", "account"]; +const MANAGE_ROLES = ["system", "head_of_admin", "admin", "head_of_accountant", "accountant"]; function globalAllow(user: RequestWithUser["user"]) { - const allowList = ["system", "head_of_admin", "head_of_account"]; + const allowList = ["system", "head_of_admin", "head_of_accountant"]; return allowList.some((v) => user.roles?.includes(v)); } diff --git a/src/controllers/04-product-controller.ts b/src/controllers/04-product-controller.ts index a5f0f0d..c6ff1cd 100644 --- a/src/controllers/04-product-controller.ts +++ b/src/controllers/04-product-controller.ts @@ -33,13 +33,13 @@ const MANAGE_ROLES = [ "system", "head_of_admin", "admin", - "head_of_account", - "account", + "head_of_accountant", + "accountant", "head_of_sale", ]; function globalAllow(user: RequestWithUser["user"]) { - const allowList = ["system", "head_of_admin", "head_of_account", "head_of_sale"]; + const allowList = ["system", "head_of_admin", "head_of_accountant", "head_of_sale"]; return allowList.some((v) => user.roles?.includes(v)); } diff --git a/src/controllers/04-product-group-controller.ts b/src/controllers/04-product-group-controller.ts index 20a3f5b..67db0ed 100644 --- a/src/controllers/04-product-group-controller.ts +++ b/src/controllers/04-product-group-controller.ts @@ -50,13 +50,13 @@ const MANAGE_ROLES = [ "system", "head_of_admin", "admin", - "head_of_account", - "account", + "head_of_accountant", + "accountant", "head_of_sale", ]; function globalAllow(user: RequestWithUser["user"]) { - const allowList = ["system", "head_of_admin", "head_of_account", "head_of_sale"]; + const allowList = ["system", "head_of_admin", "head_of_accountant", "head_of_sale"]; return allowList.some((v) => user.roles?.includes(v)); } diff --git a/src/controllers/04-service-controller.ts b/src/controllers/04-service-controller.ts index 5ef3023..1cf16fe 100644 --- a/src/controllers/04-service-controller.ts +++ b/src/controllers/04-service-controller.ts @@ -34,13 +34,13 @@ const MANAGE_ROLES = [ "system", "head_of_admin", "admin", - "head_of_account", - "account", + "head_of_accountant", + "accountant", "head_of_sale", ]; function globalAllow(user: RequestWithUser["user"]) { - const allowList = ["system", "head_of_admin", "head_of_account", "head_of_sale"]; + const allowList = ["system", "head_of_admin", "head_of_accountant", "head_of_sale"]; return allowList.some((v) => user.roles?.includes(v)); } diff --git a/src/controllers/05-payment-controller.ts b/src/controllers/05-payment-controller.ts index 67e20d9..9f73b75 100644 --- a/src/controllers/05-payment-controller.ts +++ b/src/controllers/05-payment-controller.ts @@ -23,10 +23,10 @@ import { createPermCondition, } from "../services/permission"; -const MANAGE_ROLES = ["system", "head_of_admin", "admin", "head_of_account", "account"]; +const MANAGE_ROLES = ["system", "head_of_admin", "admin", "head_of_accountant", "accountant"]; function globalAllow(user: RequestWithUser["user"]) { - const allowList = ["system", "head_of_admin", "head_of_account"]; + const allowList = ["system", "head_of_admin", "head_of_accountant"]; return allowList.some((v) => user.roles?.includes(v)); } diff --git a/src/controllers/05-quotation-controller.ts b/src/controllers/05-quotation-controller.ts index 8986757..92c35a6 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -147,14 +147,14 @@ const MANAGE_ROLES = [ "system", "head_of_admin", "admin", - "head_of_account", - "account", + "head_of_accountant", + "accountant", "head_of_sale", "sale", ]; function globalAllow(user: RequestWithUser["user"]) { - const allowList = ["system", "head_of_admin", "head_of_account", "head_of_sale"]; + const allowList = ["system", "head_of_admin", "head_of_accountant", "head_of_sale"]; return allowList.some((v) => user.roles?.includes(v)); }