presentation/providers/entitlement_providers library
Classes
- CurrentEntitlementsProvider
- The current user's entitlements. Loaded on first access and cached until invalidated (on sign-in/out, purchase completion, or admin grant change).
- EntitlementDatasourceProvider
- Singleton datasource wrapping the Supabase client.
- EntitlementInvalidationWatcherProvider
-
Background watcher that subscribes to Supabase Realtime on the
admin_grantsandsubscriptionstables and invalidates the cached currentEntitlementsProvider on any change. RLS still filters which rows the client receives — only grants/subs targeting the current user (or their org, as an admin) will trigger an event. - OrgEntitlement
-
Flattened view of the
org_entitlements()JSONB return value. - OrgEntitlementsFamily
- Per-organization entitlements — what does THIS org's plan unlock, regardless of which orgs the caller also belongs to.
- OrgEntitlementsProvider
- Per-organization entitlements — what does THIS org's plan unlock, regardless of which orgs the caller also belongs to.
Properties
- currentEntitlementsProvider → CurrentEntitlementsProvider
-
The current user's entitlements. Loaded on first access and cached until
invalidated (on sign-in/out, purchase completion, or admin grant change).
final
- entitlementDatasourceProvider → EntitlementDatasourceProvider
-
Singleton datasource wrapping the Supabase client.
final
- entitlementInvalidationWatcherProvider → EntitlementInvalidationWatcherProvider
-
Background watcher that subscribes to Supabase Realtime on the
admin_grantsandsubscriptionstables and invalidates the cached currentEntitlementsProvider on any change. RLS still filters which rows the client receives — only grants/subs targeting the current user (or their org, as an admin) will trigger an event.final - orgEntitlementsProvider → OrgEntitlementsFamily
-
Per-organization entitlements — what does THIS org's plan unlock,
regardless of which orgs the caller also belongs to.
final
Functions
-
currentEntitlements(
Ref ref) → Future< Entitlement> - The current user's entitlements. Loaded on first access and cached until invalidated (on sign-in/out, purchase completion, or admin grant change).
-
entitlementDatasource(
Ref ref) → EntitlementDatasource - Singleton datasource wrapping the Supabase client.
-
entitlementInvalidationWatcher(
Ref ref) → Future< void> -
Background watcher that subscribes to Supabase Realtime on the
admin_grantsandsubscriptionstables and invalidates the cached currentEntitlementsProvider on any change. RLS still filters which rows the client receives — only grants/subs targeting the current user (or their org, as an admin) will trigger an event. -
orgEntitlements(
Ref ref, String orgId) → Future< OrgEntitlement> - Per-organization entitlements — what does THIS org's plan unlock, regardless of which orgs the caller also belongs to.