@beholdio/ts-lambda-api - v2.4.8
    Preparing search index...

    Interface IAuthorizer<T>

    Authorizer to perform role based checks for a principal.

    Principal data type, the type must extend Principal

    interface IAuthorizer<T extends Principal> {
        name: string;
        authorize(principal: T, role: string): Promise<boolean>;
    }

    Type Parameters

    Index

    Properties

    Methods

    Properties

    name: string

    A human readable name for this authorizer.

    Methods

    • Check that a principal has a named role.

      Parameters

      • principal: T

        The current principal context.

      • role: string

        The name of the role to check for.

      Returns Promise<boolean>

      true if the principal is authorised to use the name role, otherwise false.