No-Access Configuration Repository
Component Detail
Description
Read-only repository that retrieves the admin portal URL and the list of roles blocked from mobile access. Sources configuration from Supabase remote config or local constants, ensuring the no-access screen always has the correct redirect destination.
no-access-config-repository
Summaries
The No-Access Configuration Repository ensures that when users are redirected away from restricted mobile features, they are sent to the correct, organization-specific admin portal rather than a broken or generic page. This is important for maintaining a professional user experience during access-denial scenarios and for ensuring that users can quickly find the right administrative tool to complete their work. By centralizing this configuration and pulling it from a managed remote source (Supabase remote config), the business retains the ability to update redirect destinations and blocked role lists without shipping a new app version — reducing time-to-response for access policy changes.
This repository has low implementation complexity and acts as a supporting component for the no-access feature, meaning it should be delivered in the same sprint or milestone as the No-Access Route Guard and no-access screen. Key dependencies are the Supabase remote config service and the existence of org-specific configuration records. Testing must cover both the network-backed path (Supabase returns values) and the fallback path (local constants used when remote config is unavailable), as well as cache invalidation via `clearCache()`. The primary delivery risk is if Supabase remote config is not yet provisioned for target organizations, which should be validated as part of the QA checklist before release.
This is a read-only repository following the repository pattern, abstracting the data source for blocked role configuration and the admin portal URL behind a clean async interface. `getAdminPortalUrl(String orgId)` performs an async lookup keyed by organization, allowing multi-tenant deployments to redirect to the correct portal per org. `getBlockedRoles()` returns the canonical list of role strings used by the route guard's `isBlocked` check. A local cache layer sits in front of network calls to minimize redundant Supabase round trips — `clearCache()` should be called on logout or when the session changes.
Implementation should handle Supabase failures gracefully by falling back to compile-time constants to ensure the no-access screen is never broken even in degraded network conditions.
Responsibilities
- Provide the admin portal URL for a given organization
- Return the canonical list of roles excluded from mobile access
- Cache configuration to avoid redundant network calls
Interfaces
getAdminPortalUrl(String orgId): Future<String>
getBlockedRoles(): List<String>
clearCache()
Relationships
Related Data Entities (3)
Data entities managed by this component