diff --git a/frontend/src/components/layout/side-components/production.tsx b/frontend/src/components/layout/side-components/production.tsx index 5316b2c..d55bc97 100644 --- a/frontend/src/components/layout/side-components/production.tsx +++ b/frontend/src/components/layout/side-components/production.tsx @@ -15,7 +15,7 @@ const items = [ title: "One Click Print", url: "/ocp", icon: Printer, - role: ["viwer"], + role: [], module: "ocp", active: true, }, diff --git a/frontend/src/utils/userAccess.ts b/frontend/src/utils/userAccess.ts index 5977769..4d95af0 100644 --- a/frontend/src/utils/userAccess.ts +++ b/frontend/src/utils/userAccess.ts @@ -13,6 +13,7 @@ export function hasAccess(user: User | null, moduleName: string | null, modules: } export function hasPageAccess(user: User | null, role: any, module_id: string): boolean { + if (role.length === 0) return true; if (!user) return false; // get only the module in the user profile