+ ErvuCheckRole.ts

This commit is contained in:
Булат Хайруллин 2025-03-27 12:28:31 +03:00
parent 56c8685a43
commit 2114a86321

View 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);
}
}