HasRoleMetadata: { allowedRoles: string[]; allowedStrategies?: AuthStrategies }

Metadata for the @Auth.hasRole decorator.

Type declaration

  • allowedRoles: string[]

    The allowed roles that the use can have to access the endpoint.

  • OptionalallowedStrategies?: AuthStrategies

    The strategies that are allowed for checking whether or not the user has one of the specified roles.

    If not set, this allows any strategy.