Skip to main content

requires_repository_check

Function requires_repository_check 

Source
pub fn requires_repository_check(
    caller: &AcpCaller,
    requested: Option<Uuid>,
) -> Result<Option<Uuid>, ScopeGuardError>
Expand description

Decide whether the caller is allowed to attach the requested scope id, without hitting the DB. Returns:

  • Ok(None) : caller has no requested scope → no enforcement needed
  • Ok(Some(acp_id)) : the middleware must consult the use-case to verify assert_caller_can_see(acp_id)
  • Err(Validation) : the caller is non-admin AND owns no role-scope information (e.g. syndic with organization_id = None AND no explicit acp_id) — refuse rather than guess.