import type { EntityPrivacyPolicyEvaluationContext } from '../EntityPrivacyPolicy.ts'; import type { EntityQueryContext } from '../EntityQueryContext.ts'; import type { ReadonlyEntity } from '../ReadonlyEntity.ts'; import type { ViewerContext } from '../ViewerContext.ts'; import { PrivacyPolicyRule, RuleEvaluationResult } from './PrivacyPolicyRule.ts'; /** * Privacy policy rule that always denies. */ export class AlwaysDenyPrivacyPolicyRule< TFields extends Record, TIDField extends keyof NonNullable>, TViewerContext extends ViewerContext, TEntity extends ReadonlyEntity, TSelectedFields extends keyof TFields = keyof TFields, > extends PrivacyPolicyRule { async evaluateAsync( _viewerContext: TViewerContext, _queryContext: EntityQueryContext, _evaluationContext: EntityPrivacyPolicyEvaluationContext< TFields, TIDField, TViewerContext, TEntity, TSelectedFields >, _entity: TEntity, ): Promise { return RuleEvaluationResult.DENY; } }