Skip to main content

Module list_acps_use_case

Module list_acps_use_case 

Source
Expand description

ListAcps use-case — Story 1.3.

Wrap AcpRepository::list(scope) derived from the caller’s role (AcpCaller::list_scope()). Provides a dedicated entry point separated from the broader AcpUseCases::list_acps so that the scope-guard middleware (cf. infrastructure::web::middleware::scope_guard) can reuse the same assert_caller_can_see_acp helper without pulling in the full CRUD use-cases.

Permissions (cf. architecture §3.3 + ADR-0010) :

  • SuperAdmin → ListScope::All (sees all ACPs)
  • Admin { org_id } / Syndic { org_id } → ListScope::Organization(org)
  • Owner { user_id } → ListScope::Owner(user_id)

All returns are typed Result<T, AppError> — CRITICAL §4. No Result<_, String> introduced (cf. epic #555). The wider repository port AcpRepository already returns AppError natively (Story 1.1).

Structs§

ListAcpsUseCase
Dedicated use-case for role-based ACP listing — Story 1.3.