GuardDrizzle.visible
function · packages/guard/src/drizzle.ts:58
visible<User, const Es extends ReadonlyArray<AnyEntity>>(
policy: Policy<User>,
entities: Es,
): {
readonly [K in Es[number]['name']]: Visible
}The visible rule of each of entities, the Entities as Guards.attach
returned them, by name, for bind's storage. Checked here, before any
request: a row guard this compiler cannot run, and an inherited Read whose
Entity is not listed, has no Read rule, or leads back to itself, throw.
ts
const visible = GuardDrizzle.visible(Policy, [Todo, Project])
bind(Domain, { Todo: { table: todos, visible: visible.Todo, … }, … })