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§
- Allow
All - A guard that refuses nothing: the default for an entity whose schema declares no rules.
- Guard
Outcome - A guard’s answer.
- Write
Ctx - One write, as the guard sees it.
Enums§
- Write
Kind - What kind of write is being checked.
Traits§
- Write
Guard - The rules one entity’s writes must satisfy.
Functions§
- as_
transition - Run
fas the state-machine verbverb: every write it makes is a transition, so a rule that keeps a state field verbs-only lets it through. A generated transition handler wraps its write in this; nothing else should. - current_
transition - The verb the current write performs, inside
as_transition.