TenantAtlas/tests/Unit
ahmido d90fb0f963 065-tenant-rbac-v1 (#79)
PR Body
Implements Spec 065 “Tenant RBAC v1” with capabilities-first RBAC, tenant membership scoping (Option 3), and consistent Filament action semantics.

Key decisions / rules

Tenancy Option 3: tenant switching is tenantless (ChooseTenant), tenant-scoped routes stay scoped, non-members get 404 (not 403).
RBAC model: canonical capability registry + role→capability map + Gates for each capability (no role-string checks in UI logic).
UX policy: for tenant members lacking permission → actions are visible but disabled + tooltip (avoid click→403).
Security still enforced server-side.
What’s included

Capabilities foundation:
Central capability registry (Capabilities::*)
Role→capability mapping (RoleCapabilityMap)
Gate registration + resolver/manager updates to support tenant-scoped authorization
Filament enforcement hardening across the app:
Tenant registration & tenant CRUD properly gated
Backup/restore/policy flows aligned to “visible-but-disabled” where applicable
Provider operations (health check / inventory sync / compliance snapshot) guarded and normalized
Directory groups + inventory sync start surfaces normalized
Policy version maintenance actions (archive/restore/prune/force delete) gated
SpecKit artifacts for 065:
spec.md, plan/tasks updates, checklists, enforcement hitlist
Security guarantees

Non-member → 404 via tenant scoping/membership guards.
Member without capability → 403 on execution, even if UI is disabled.
No destructive actions execute without proper authorization checks.
Tests

Adds/updates Pest coverage for:
Tenant scoping & membership denial behavior
Role matrix expectations (owner/manager/operator/readonly)
Filament surface checks (visible/disabled actions, no side effects)
Provider/Inventory/Groups run-start authorization
Verified locally with targeted vendor/bin/sail artisan test --compact …
Deployment / ops notes

No new services required.
Safe change: behavior is authorization + UI semantics; no breaking route changes intended.

Co-authored-by: Ahmed Darrazi <ahmeddarrazi@MacBookPro.fritz.box>
Reviewed-on: #79
2026-01-28 21:09:47 +00:00
..
Auth 065-tenant-rbac-v1 (#79) 2026-01-28 21:09:47 +00:00
BackupScheduling fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
Badges feat: unify provider connection actions and notifications (#73) 2026-01-25 01:01:37 +00:00
DirectoryGroups 051-entra-group-directory-cache (#57) 2026-01-11 23:24:12 +00:00
Intune 065-tenant-rbac-v1 (#79) 2026-01-28 21:09:47 +00:00
Inventory feat/040-inventory-core (#43) 2026-01-07 14:54:24 +00:00
Operations 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
OpsUx feat: unify provider connection actions and notifications (#73) 2026-01-25 01:01:37 +00:00
Providers feat: unify provider connection actions and notifications (#73) 2026-01-25 01:01:37 +00:00
AppProtectionPolicyNormalizerTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
AssignmentBackupServiceTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
AssignmentFetcherTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
AssignmentFilterResolverTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
AssignmentRestoreServiceTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
BackupItemTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
BulkActionPermissionTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
BulkBackupSetDeleteJobTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkBackupSetForceDeleteJobTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkBackupSetRestoreJobTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkOperationAbortMethodTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkOperationRunProgressTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkOperationRunStatusBucketTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkPolicyDeleteJobTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkPolicyExportJobTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkPolicyVersionForceDeleteJobTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkPolicyVersionPruneJobTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkPolicyVersionRestoreJobTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkRestoreRunDeleteJobTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkRestoreRunRestoreJobTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
CircuitBreakerTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
CompliancePolicyNormalizerTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
CoverageCapabilitiesResolverTest.php feat/047-inventory-foundations-nodes (#51) 2026-01-10 20:47:29 +00:00
DefaultPolicyNormalizerDiffTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
DependencyExtractionServiceTest.php feat/042-inventory-dependencies-graph (#50) 2026-01-10 12:50:08 +00:00
DependencyTargetResolverTest.php feat/042-inventory-dependencies-graph (#50) 2026-01-10 12:50:08 +00:00
DeviceConfigurationPolicyNormalizerTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
ExampleTest.php Initial commit from Specify template 2025-12-10 22:27:21 +01:00
FoundationMappingServiceTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
FoundationSnapshotServiceTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
GraphClientEndpointResolutionTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
GraphClientScopeTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
GraphContractFallbackTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
GraphContractRegistryActualDataTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
GraphContractRegistrySettingsApplySanitizerTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
GraphContractRegistrySettingsWriteStrategyTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
GraphContractRegistryTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
GroupResolverTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
InventoryLinkTest.php feat/042-inventory-dependencies-graph (#49) 2026-01-10 00:20:14 +00:00
ManagedDeviceAppConfigurationNormalizerTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
MicrosoftGraphClientListPoliciesSelectTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
MicrosoftGraphClientRetryPolicyTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
MicrosoftGraphClientTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
ODataTypeValidationTest.php feat/011-restore-run-wizard (#37) 2026-01-07 01:40:04 +00:00
PolicyCaptureOrchestratorTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
PolicyNormalizerRoutingTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
PolicyNormalizerSettingsCatalogFlattenTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
PolicyNormalizerSettingsCatalogTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
PolicyNormalizerTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
PolicyPickerOptionLabelTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
PolicySnapshotServiceTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
PolicyVersionEligibilityTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
RbacOnboardingServiceTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
RestoreRunDeletableTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
RestoreRunTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
RunIdempotencyTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
ScopeTagResolverTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
ScriptsPolicyNormalizerTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
SettingsCatalogPolicyNormalizerTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
TenantCurrentTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
TenantPermissionServiceTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
TenantResourceConsentUrlTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
TenantScopeTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00
VersionDiffTest.php feat: TenantPilot v1 - Complete implementation (Phases 1-12) 2025-12-12 02:27:54 +01:00
WindowsDriverUpdateProfileNormalizerTest.php fix(tests): remove per-file TestCase uses (#45) 2026-01-08 00:41:46 +00:00