method IAuthorizationService.hasRole
IAuthorizationService.hasRole(
principal: IPrincipal,
role: string
): boolean

Check if a principal has a specific role (including inherited roles).

Parameters

principal: IPrincipal

The principal to check

role: string

The role name to check

Return Type

boolean

true if the principal has the role

Usage

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