fix(user): when user didnt hape permissions would error, changed to have undefined now

This commit is contained in:
2025-03-10 09:35:52 -05:00
parent 12e15babb4
commit 65b35bc9a3

View File

@@ -18,7 +18,7 @@ export function hasPageAccess(user: User | null, role: any, module_id: string):
// get only the module in the user profile // get only the module in the user profile
const userRole = user?.roles.filter((role) => role.module_id === module_id); const userRole = user?.roles.filter((role) => role.module_id === module_id);
if (role.includes(userRole[0].role)) { if (role.includes(userRole[0]?.role)) {
return true; return true;
} }