Skip to content

evaluateQueryConstraint

evaluateQueryConstraint(props): QueryConstraintOutcome

Defined in: packages/core/src/access/evaluateQueryConstraint.ts:114

Runs a constrained rule’s withIndex and where for one caller and assembles the result.

Input props.

Record<string, unknown>

{ user } plus { organization } when configured. Pass the user-read sentinel’s proxy here, as the callers do today, so a rule keyed to an absent caller is detected.

{ where?: unknown; withIndex?: unknown; }

The rule object; at least one of withIndex / where is present. withIndex is the static { name, range } or a callback returning one or a boolean; where is a plain where node, or a callback returning a predicate or a boolean. filter is ignored here — it is per-document, and hasPermission runs it.

unknown

unknown

QueryConstraintOutcome

The rule’s outcome for this caller.

Whatever a callback throws — validateAccessConfig wraps it in a VexAccessConfigError naming the rule.