Entity

    Class AuthorizationResultBasedEntityLoader<TFields, TIDField, TViewerContext, TEntity, TPrivacyPolicy, TSelectedFields>

    Authorization-result-based entity loader. All normal loads are batched, cached, and authorized against the entity's EntityPrivacyPolicy. All loads through this loader are are results (or null for some loader methods), where an unsuccessful result means an authorization error or entity construction error occurred. Other errors are thrown.

    Type Parameters

    Index

    Constructors

    Properties

    metricsAdapter: IEntityMetricsAdapter
    utils: EntityLoaderUtils<
        TFields,
        TIDField,
        TViewerContext,
        TEntity,
        TPrivacyPolicy,
        TSelectedFields,
    >

    Methods

    • Authorization-result-based version of the EnforcingEntityLoader method by the same name.

      Type Parameters

      • N extends string | number | symbol

      Parameters

      • uniqueFieldName: N
      • fieldValue: NonNullable<TFields[N]>

      Returns Promise<null | Result<TEntity>>

      entity result where uniqueFieldName equals fieldValue, or null if no entity matches the condition.

      when multiple entities match the condition

    • Authorization-result-based version of the EnforcingEntityLoader method by the same name.

      Type Parameters

      • N extends string | number | symbol

      Parameters

      • fieldName: N
      • fieldValue: NonNullable<TFields[N]>

      Returns Promise<readonly Result<TEntity>[]>

      array of entity results that match the query for fieldValue, where result error can be UnauthorizedError

    • Authorization-result-based version of the EnforcingEntityLoader method by the same name.

      Type Parameters

      • N extends string | number | symbol

      Parameters

      • fieldName: N
      • fieldValues: readonly NonNullable<TFields[N]>[]

      Returns Promise<ReadonlyMap<NonNullable<TFields[N]>, readonly Result<TEntity>[]>>

      map from fieldValue to entity results that match the query for that fieldValue, where result errors can be UnauthorizedError

    MMNEPVFCICPMFPCPTTAAATR