#63 temporary commented the ROLE_ADMIN

This commit is contained in:
Fabio Formosa
2022-10-07 22:33:00 +02:00
parent 6eed819364
commit a30bd9e2c7
2 changed files with 9 additions and 7 deletions

View File

@@ -13,12 +13,14 @@ export class AdminGuard implements CanActivate {
return true;
}
if (this.userService.currentUser) {
if (JSON.stringify(this.userService.currentUser.authorities).search('ROLE_ADMIN') !== -1) {
return true;
} else {
this.router.navigate(['/403']);
return false;
}
return true;
// to be enable again in the scope of the card #65
// if (JSON.stringify(this.userService.currentUser.authorities).search('ROLE_ADMIN') !== -1) {
// return true;
// } else {
// this.router.navigate(['/403']);
// return false;
// }
} else {
console.log('NOT AN ADMIN ROLE');
this.router.navigate(['/login'], {queryParams: {returnUrl: state.url}});

View File

@@ -1,3 +1,3 @@
<p>
Your access doesn't allow!!
Forbbiden - Your access doesn't allow!!
</p>