test(ocme): cycle count intital improvements

This commit is contained in:
2025-03-19 21:45:10 -05:00
parent e17b8e7bbe
commit 7a22b52c91
19 changed files with 709 additions and 33 deletions

View File

@@ -13,15 +13,13 @@ 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 (role.includes("viewer")) return true;
if (!user) return false;
// get only the module in the user profile
const userRole = user?.roles.filter((role) => role.module_id === module_id);
if (role.includes(userRole[0]?.role)) {
return true;
}
if (role.includes(userRole[0]?.role)) return true;
return false;
}