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",
|
title: "One Click Print",
|
||||||
url: "/ocp",
|
url: "/ocp",
|
||||||
icon: Printer,
|
icon: Printer,
|
||||||
role: ["viwer"],
|
role: [],
|
||||||
module: "ocp",
|
module: "ocp",
|
||||||
active: true,
|
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 {
|
export function hasPageAccess(user: User | null, role: any, module_id: string): boolean {
|
||||||
|
if (role.length === 0) return true;
|
||||||
if (!user) return false;
|
if (!user) return false;
|
||||||
|
|
||||||
// get only the module in the user profile
|
// get only the module in the user profile
|
||||||
|
|||||||
Reference in New Issue
Block a user