Marks an endpoint to be only reachable when the logged in user has one of the provided roles.

  • Parameters

    • allowedRoles: string[]

      All roles that are allowed to access this endpoint.

    • OptionalallowedStrategies: AuthStrategies

      The auth strategies that are allowed to be used to check that.

    Returns MethodDecorator & ClassDecorator

Properties

Properties

skip: () => MethodDecorator & ClassDecorator

This skips the has role validation.