refactor(view access): if role [] then allow them to see it
This commit is contained in:
@@ -15,7 +15,7 @@ const items = [
|
||||
title: "One Click Print",
|
||||
url: "/ocp",
|
||||
icon: Printer,
|
||||
role: ["viwer"],
|
||||
role: [],
|
||||
module: "ocp",
|
||||
active: true,
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user