Guard / foldkit-guard
Lower level: asking the Policy yourself
Custom Sources and interpreters can query Policy directly via readable,
readMembers, writable, writeMembers, and linkable:
ts
import { Condition } from 'foldkit-guard'
const ada = Option.some({ id: 'ada', role: 'member' as const, projectIds: ['p1'] })
const readable = Effect.runSync(Policy.readable(Todo, ada))
// isAdmin was false, so: isOwner or inProject, over each row
const t1 = { id: 't1', ownerId: 'ada', projectId: 'p9', title: 'Write the README' }
Condition.holds(readable, t1, Policy.inputOf(ada), () => false, Policy.operators)
// trueCondition.alwaysandCondition.nevershort-circuit row scans when principal guards alone decide access.Condition.holdsevaluates a condition over an in-memory row; its fourth argument resolves inheritedReadrelations.