zibri
    Preparing search index...

    Type Alias BelongsToMetadata<TargetEntity>

    Metadata for the @Auth.belongsTo decorator.

    type BelongsToMetadata<TargetEntity extends Newable<BaseEntity>> = {
        allowedStrategies?: AuthStrategies;
        targetEntity: TargetEntity;
        targetIdParamKey: string;
        targetUserIdKey: keyof InstanceType<TargetEntity>;
    }

    Type Parameters

    Index

    Properties

    allowedStrategies?: 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.