Merge remote-tracking branch 'origin/develop' into develop
* origin/develop: по умолчанию первоначалка открываться будет + ErvuCheckRole.ts
This commit is contained in:
commit
f81eab879a
2 changed files with 17 additions and 1 deletions
16
frontend/src/ts/ervu_business_metrics/ErvuCheckRole.ts
Normal file
16
frontend/src/ts/ervu_business_metrics/ErvuCheckRole.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
import {AnalyticalScope, Behavior, Visible} from "@webbpm/base-package";
|
||||||
|
import {AuthorizationService} from "../modules/app/service/authorization.service";
|
||||||
|
|
||||||
|
@AnalyticalScope(Behavior)
|
||||||
|
export class ErvuCheckRole extends Behavior {
|
||||||
|
private authService: AuthorizationService;
|
||||||
|
|
||||||
|
initialize() {
|
||||||
|
this.authService = this.injector.get(AuthorizationService);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Visible()
|
||||||
|
public hasRoles(roles: string[]): boolean {
|
||||||
|
return this.authService.hasAnyRole(roles);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -13,7 +13,7 @@ const webbpmRoutes: Routes = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
loadChildren: 'generated-sources/page-conversion.module#PageconversionModule',
|
loadChildren: 'generated-sources/page-initial_registration.module#Pageinitial_registrationModule',
|
||||||
canActivate: [ConfirmExitGuard, RolesGuard],
|
canActivate: [ConfirmExitGuard, RolesGuard],
|
||||||
pathMatch: 'full',
|
pathMatch: 'full',
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue