mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5009] close all the dialogs after false canActivate event (#5312)
* close all the dialogs after false canActivate event * Update auth-guard-bpm.service.spec.ts * sso fix * fix lint
This commit is contained in:
committed by
Denys Vuika
parent
d7e56b641e
commit
9c83c35e61
@@ -18,12 +18,16 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { JwtHelperService } from './jwt-helper.service';
|
||||
import { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router';
|
||||
import { MatDialog } from '@angular/material';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AuthGuardSsoRoleService implements CanActivate {
|
||||
|
||||
constructor(private jwtHelperService: JwtHelperService, private router: Router, private dialog: MatDialog) {
|
||||
}
|
||||
|
||||
canActivate(route: ActivatedRouteSnapshot): boolean {
|
||||
let hasRole;
|
||||
let hasRealmRole = false;
|
||||
@@ -48,9 +52,10 @@ export class AuthGuardSsoRoleService implements CanActivate {
|
||||
this.router.navigate(['/' + route.data['redirectUrl']]);
|
||||
}
|
||||
|
||||
if (!hasRole) {
|
||||
this.dialog.closeAll();
|
||||
}
|
||||
|
||||
return hasRole;
|
||||
}
|
||||
|
||||
constructor(private jwtHelperService: JwtHelperService, private router: Router) {
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user