method IAuthorizationService.hasAnyRole
IAuthorizationService.hasAnyRole(
principal: IPrincipal,
roles: readonly string[]
): boolean

Check if a principal has any of the specified roles.

Parameters

principal: IPrincipal

The principal to check

roles: readonly string[]

The role names to check

Return Type

boolean

true if the principal has any of the roles

Usage

import { type IAuthorizationService } from "auth-plugin/src/index.ts";