fix(user): when user didnt hape permissions would error, changed to have undefined now
This commit is contained in:
@@ -18,7 +18,7 @@ export function hasPageAccess(user: User | null, role: any, module_id: string):
|
||||
// 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)) {
|
||||
if (role.includes(userRole[0]?.role)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user