Authorization data.

interface Authorization {
    getName(): undefined | string;
    getRoles(): string[];
    hasRole(name: string): boolean;
    readonly [key: string]: unknown;
}

Indexable

  • readonly [key: string]: unknown

    may have extra keys

Methods

  • Gets the name of the User that this Authorization context was created for. or undefined if created for not authenticated user.

    Returns undefined | string

  • Gets the names of all roles implied by this Authorization context.

    Returns string[]

  • Checks if the role with the specified name is implied by this Authorization context.

    Parameters

    • name: string

      The name of the role to check for.

    Returns boolean