Skip to content

ownerPredicateCheck

ownerPredicateCheck<S, F>(props): AccessMutationCheck<S>

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

Builds a single-document check that passes only when field names the requesting user.

A per-document predicate rather than an index range: create/update/delete authorize one document, so there is nothing to narrow (DD 14). field is therefore any readable field, not only an indexed one.

S extends string

Resource slug, inferred from props.resource.

F extends string

Owner field on S.

Input props.

F

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

AccessResourceRef<S>

The resource this check governs.

AccessMutationCheck<S>

A check assignable to a non-query action on S.