Removed themeService from templates #70

This commit is contained in:
2022-10-16 12:57:27 +02:00
parent ba881aefa8
commit 1a3126dfc5
7 changed files with 91 additions and 56 deletions

View File

@@ -28,10 +28,13 @@ export class AuthGuard implements CanActivate {
const role = route.data['role'];
if (role) {
if (!await this.authService.hasUserPermission(role)) {
this.router.navigate(['/dashboard']);
return false;
}
this.authService.hasUserPermission(role).then(hasPermission => {
if (!hasPermission) {
this.router.navigate(['/dashboard']);
return false;
}
return true;
});
}
return true;
}