Skip to main content

Module write_guard

Module write_guard 

Source
Expand description

The write guard: the rules a write must satisfy, asked on every path the generic service writes through.

GenericCrudService consults its guard on create, update (full and partial, single and bulk), soft delete, restore and hard delete, after the write’s resulting row is known and before anything is persisted. A guard answers with violations to refuse and violations to only report: a rule that runs in shadow is logged and the write proceeds, so a newly compiled rule shows what it would refuse before it refuses anything. The schema generator compiles a module’s declared rules into guards; without one, every write is allowed (AllowAll).

Structs§

AllowAll
A guard that refuses nothing: the default for an entity whose schema declares no rules.
GuardOutcome
A guard’s answer.
WriteCtx
One write, as the guard sees it.

Enums§

WriteKind
What kind of write is being checked.

Traits§

WriteGuard
The rules one entity’s writes must satisfy.