Type Alias BelongsToMetadata<TargetEntity>

BelongsToMetadata: {
    allowedStrategies?: AuthStrategies;
    targetEntity: TargetEntity;
    targetIdParamKey: string;
    targetUserIdKey: keyof InstanceType<TargetEntity>;
}

Metadata for the @Auth.belongsTo decorator.

Type Parameters

Type declaration

  • 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.

  • targetEntity: TargetEntity

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

  • targetIdParamKey: string

    The key of the id path parameter in the endpoint.

  • targetUserIdKey: keyof InstanceType<TargetEntity>

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