resolveAccessConstraint
resolveAccessConstraint<
TSubjects>(props):AccessFilterFn|undefined
Defined in: packages/core/src/access/resolveAccessRule.ts:304
Resolves an access rule to a .filter() expression, if any.
The sibling of resolveAccessIndex, for query shapes with no withIndex
slot to claim (search) or where the caller’s own index already claimed it
(find’s displaced branch). Both share selectSingleCondition, so they
cannot disagree about which rule applies.
Succeeds for BOTH halves of a condition. An indexed rule’s positional
constraints compile to a filter expression just as well as they do to a range —
the whole point of recording data rather than a callback — and a flat rule’s tree
compiles here too. When a condition carries both, they are and-ed.
Type Parameters
Section titled “Type Parameters”TSubjects
Section titled “TSubjects”TSubjects extends Record<string, SubjectEntry> = Record<string, SubjectEntry>
Parameters
Section titled “Parameters”Input props.
access?
Section titled “access?”VexAccessConfig<TSubjects, readonly AccessResource[], string, string | undefined, Partial<Record<string, CustomActionsInput>>>
Resolved access config; absent or enabled: false ⇒ no filter.
action
Section titled “action”string
Query-shaped action.
indexAlreadyApplied?
Section titled “indexAlreadyApplied?”boolean
Set when the caller already pushed this rule’s
index range down via .withIndex(name, range). The range is then omitted here,
leaving only the filter half — applying it twice would be redundant work on
every row. Leave unset (find’s displaced branch, search, get) to get the
whole condition as one expression.
organization?
Section titled “organization?”Record<string, unknown>
Active organization, forwarded to the rule’s callback.
resource
Section titled “resource”string
Subject slug.
Record<string, unknown> | null
Caller, or null for anonymous (resolves through access.anonRole).
Returns
Section titled “Returns”AccessFilterFn | undefined
A thunk taking the query’s own FilterBuilder, or undefined when
nothing is left to exclude.