Skip to main content

validate_component_write

Function validate_component_write 

Source
pub fn validate_component_write(
    change: &ComponentChange<'_>,
    registry: &ComponentRegistry,
) -> Result<(), ComponentPermissionError>
Expand description

Validate whether the change’s actor is allowed to perform the proposed ComponentChange.

Three-layer check:

  1. Immutability: a component in an immutable range rejects every delete, and every write once it has a value. An absent immutable component accepts its first write under its policy: a scalar Update or collection Inserts. A map-element Update could only rewrite a key the same delta inserted, so it is refused.
  2. Hardcoded: the component registry and the super admin list are super admin only, except that a DM participant may change application-range registry entries.
  3. Registry lookup: All other components must have an entry in the component registry. No entry = denied (deny by default).