RED-3585: Fixed user admin role guard

This commit is contained in:
Adina Țeudan 2022-03-14 15:22:56 +02:00
parent 5b743ecf8e
commit 334aff5c9d

View File

@ -25,6 +25,18 @@ export class RedRoleGuard implements CanActivate {
}
// we have at least 1 RED Role -> if it's not user he must be admin
if (
this._userService.currentUser.isUserAdmin &&
!this._userService.currentUser.isAdmin &&
state.url.includes('admin') &&
!state.url.includes('users')
) {
this._router.navigate(['/main/admin/users']);
obs.next(false);
obs.complete();
return;
}
if (
this._userService.currentUser.isUserAdmin &&
!this._userService.currentUser.isAdmin &&