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