#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; return true;
} }
if (this.userService.currentUser) { if (this.userService.currentUser) {
if (JSON.stringify(this.userService.currentUser.authorities).search('ROLE_ADMIN') !== -1) { return true;
return true; // to be enable again in the scope of the card #65
} else { // if (JSON.stringify(this.userService.currentUser.authorities).search('ROLE_ADMIN') !== -1) {
this.router.navigate(['/403']); // return true;
return false; // } else {
} // this.router.navigate(['/403']);
// return false;
// }
} else { } else {
console.log('NOT AN ADMIN ROLE'); console.log('NOT AN ADMIN ROLE');
this.router.navigate(['/login'], {queryParams: {returnUrl: state.url}}); this.router.navigate(['/login'], {queryParams: {returnUrl: state.url}});

View File

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