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:
- 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).
- Hardcoded: The hardcoded components (component registry, super admin list) have permissions enforced in code: super admin only.
- Registry lookup: All other components must have an entry in the component registry. No entry = denied (deny by default).