Enterprise boundaries
EnterpriseScope, RBAC, audit, secure interop and bootstrap mode.
EnterpriseScopeLink to this section: EnterpriseScope
Org-scoped enterprise ports require an EnterpriseScope. A missing organizationId throws — they never return all tenants.
/// Fail-closed tenant + actor context for enterprise ports (ADR-002).
class EnterpriseScope {
final String organizationId;
final String actorId;
final PermissionSet permissions;
/// Throws if [organizationId] is missing/blank — never allow all-tenant lists.
static String requireOrganizationId(String? organizationId) {
final id = organizationId?.trim() ?? '';
if (id.isEmpty) {
throw StateError(
'EnterpriseScope: organizationId is required (fail-closed tenancy).',
);
}
return id;
}
}Source supercore/packages/after_enterprise/lib/src/scope/enterprise_scope.dart (opens in a new tab)
RBAC and auditLink to this section: RBAC and audit
Vertical features check PermissionSet.allows(...) before any mutating call. Products declare their own permission strings.
Every mutating enterprise action must append an AuditLogEntry to the append-only AuditLogRepository.
Secure interopLink to this section: Secure interop
Cross-product calls go through AfterSecureInteropBridge: After ID audience, scopes, RBAC and org membership, then a mandatory audit entry.
- After ID audience check
- Scopes, RBAC and organization membership when an organization is present
- Mandatory audit entry
- Optional data minimization by endpoint schema
Bootstrap modeLink to this section: Bootstrap mode
In production mode a missing adapter throws at startup, so mock providers cannot silently reach production.
/// Composition safety mode (ADR-007).
///
/// - [scaffold]: in-memory / mock adapters are allowed (templates, tests).
/// - [production]: missing real adapters must throw at startup.
enum AfterBootstrapMode {
scaffold,
production,
}Source supercore/packages/after_core/lib/src/bootstrap/after_bootstrap_mode.dart (opens in a new tab)
Enterprise portsLink to this section: Enterprise ports
Real backends replace MockEnterpriseRepository at the composition root. The OS layer never learns the vendor's name.
- EnterpriseScope
- OrganizationRepository
- RbacRepository
- PermissionSet
- WorkflowEngine
- TaskRepository
- CalendarRepository
- DocumentRepository
- EnterpriseAiAssistant
- AuditLogRepository
- OfflineSyncQueue
- EnterpriseApiClient
- MockEnterpriseRepository
- EnterpriseProductRuntime
static Future<List<Override>> ensureConfigured({
EnterpriseRepository? enterpriseRepository,
}) async {
PlatformConfig.current = superAppEnterpriseManifest;
final prefs = await SharedPreferences.getInstance();
return [
...AfterStandardOverrides.create(
preferences: prefs,
userAgent: '${superAppEnterpriseManifest.appName}/'
'${superAppEnterpriseManifest.appId}',
),
enterpriseRepositoryProvider.overrideWithValue(
enterpriseRepository ?? MockEnterpriseRepository(),
),
];
}Source supercore/templates/super_app_enterprise/after_framework.dart (opens in a new tab)
These are architectural controls documented in the supercore repository. After Framework makes no claims of certification or regulatory compliance.