Skip to content

indexedOwnerCheck

indexedOwnerCheck<S, F>(props): AccessCheck<S>

Defined in: packages/core/src/access/buildChecks.ts:122

Builds a read check narrowed to rows the requesting user owns, pushed into the owner field’s index.

The comparison value is built per request from user, and its shape follows the field’s declared type: a relationship column stores Id[], so the value is [user._id]; anything else compares the id directly. That decision needs the resource config, which is why this is a distinct builder rather than a call to indexedEqCheck.

S extends string

Resource slug, inferred from props.resource.

F extends string

Owner field, constrained to S’s index-leading fields.

Input props.

F

The owner field, e.g. "authorId".

AccessResourceRef<S>

The resource this check governs.

AccessCheck<S>

A check assignable to permissions[role][S].read.