+ ErvuCheckRole.ts
This commit is contained in:
parent
56c8685a43
commit
2114a86321
1 changed files with 16 additions and 0 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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue