Interface: TableAuth<TCtx>
Interface: TableAuth<TCtx>
Section titled “Interface: TableAuth<TCtx>”Defined in: core/src/schema/table.ts:56
Row-level authorization rules attached to a table. Both callbacks receive
the request-scoped ctx (typed at the mutators’ definition site) and the
row as a plain object.
read(ctx, row)— controls whether the row is included insync/pullpatches for this ctx. Applied per change record; afalsereturn silently drops the row from the response.write(ctx, row)— controls whether the ctx may insert / update / delete this row. Afalsereturn aborts the mutation’s transaction; the mutation id still advances so the client isn’t stuck retrying.
Both callbacks default to “always allow” when omitted. Rules are only
evaluated inside the sync handler — the raw driver escape hatch and
createServerDb bypass authorization deliberately (background jobs
often need cross-user visibility).
Type Parameters
Section titled “Type Parameters”TCtx = unknown
Properties
Section titled “Properties”
optionalread?: (ctx,row) =>boolean
Defined in: core/src/schema/table.ts:57
Parameters
Section titled “Parameters”TCtx
Record<string, unknown>
Returns
Section titled “Returns”boolean
write?
Section titled “write?”
optionalwrite?: (ctx,row) =>boolean
Defined in: core/src/schema/table.ts:58
Parameters
Section titled “Parameters”TCtx
Record<string, unknown>
Returns
Section titled “Returns”boolean