Guard / foldkit-guard
Limits
mayreflects the last read row: live patches to guarded fields require a refetch to refreshmay.- Custom handlers check their own fields:
GuardServer.mutationchecks the row rule for its interaction; field-level and link-level rules inside custom handler bodies stay the handler's responsibility. - Cross-row
Readrules skip live list placement:Guards.attachtracks own-rowReadfields for list refetches, while changes on reached rows stay at the list's last read until refetched. - Sync documents share one audience: per-member or per-row secrecy inside a
replicated Sync document is refused by
GuardSync.document. - Revisions pin declared writes: raw SQL or migrations outside declared
writes advance revisions only if the database installs
revisionTriggerfromfoldkit-remote-drizzle(omitted on Sync-managed tables). - Sync
admitlags the journal slightly:admitreads the current table when admitted, so concurrent ownership changes belong in guarded Remote writes outside the Sync document. - Sync
authorizeruns synchronously: keep principal guard bodies synchronous when used with Sync. - Server-owned creator fields: declare fields like
ownerIdwithEntity.setssoRemoteServer.writepopulates them before guards evaluate.
Next
- Walk through sign-in and permissions end to end: How Guard works
- Connect authentication to guards: Auth and Guard
- Declare updates and deletes with row guards: Declared writes
- Run a complete guarded application:
examples/auth