Marks an endpoint to be only reachable when the logged in user belongs to the requested resource somehow.

  • Type Parameters

    Parameters

    • targetEntity: T

      The target entity that needs to be checked to belong to the user.

    • OptionaltargetIdParamKey: string

      The key of the id path parameter in the endpoint.

    • OptionaltargetUserIdKey: keyof InstanceType<T>

      The key on the target, that defines to which user it belongs.

    • 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 belongs to validation.