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: Components in immutable ranges reject update and delete unconditionally — only insert is allowed (and only if the component doesn’t exist yet, which the caller must verify).
  2. Hardcoded: The hardcoded components (component registry, super admin list) have permissions enforced in code: super admin only.
  3. Registry lookup: All other components must have an entry in the component registry. No entry = denied (deny by default).