Skip to content

AccessFn

AccessFn<R> = (ctx, record?, input?) => AccessResult | Promise<AccessResult>

Defined in: packages/schema/src/access/types.ts:53

A rule at the resource level. Without a record it decides the operation and may return a row filter; with (ctx, record, input) it is a record-level check. A rule that reads the record or input when called without them, or throws a TypeError, marks the operation as record-checked; a list is then refused, since it does not run the rule on each row.

R = any

AccessContext

R

Partial<R>

AccessResult | Promise<AccessResult>