TenantAtlas/tests/Feature/Filament
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
..
AdminSmokeTest.php 057-filament-v5-upgrade (#66) 2026-01-20 21:19:27 +00:00
AppProtectionPolicySettingsDisplayTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
BackupCreationTest.php 015-policy-picker-ux (#21) 2026-01-02 13:59:15 +00:00
BackupItemsBulkRemoveTest.php 054-unify-runs-suitewide (#63) 2026-01-17 22:25:00 +00:00
BackupItemsNoPollingTest.php 057-filament-v5-upgrade (#66) 2026-01-20 21:19:27 +00:00
BackupSetGraphSafetyTest.php feat/048-backup-restore-ui-graph-safety (#55) 2026-01-11 00:14:35 +00:00
BackupSetPolicyPickerTableTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
ConditionalAccessPreviewOnlyTest.php feat/049-backup-restore-job-orchestration (#56) 2026-01-11 15:59:06 +00:00
EnrollmentAutopilotSettingsDisplayTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
EnrollmentRestrictionsPreviewOnlyTest.php feat/049-backup-restore-job-orchestration (#56) 2026-01-11 15:59:06 +00:00
EntraGroupSyncRunResourceTest.php 051-entra-group-directory-cache (#57) 2026-01-11 23:24:12 +00:00
FilamentBootsTest.php 057-filament-v5-upgrade (#66) 2026-01-20 21:19:27 +00:00
FilamentNotificationsAssetsTest.php 057-filament-v5-upgrade (#66) 2026-01-20 21:19:27 +00:00
GroupPolicyConfigurationHydrationTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
GroupPolicyConfigurationNormalizedDiffTest.php feat(010): Administrative Templates – restore from PolicyVersion + version visibility (#13) 2025-12-30 01:50:05 +00:00
GroupPolicyConfigurationRestoreTest.php feat/049-backup-restore-job-orchestration (#56) 2026-01-11 15:59:06 +00:00
HousekeepingTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
InventoryHubDbOnlyTest.php 058-tenant-ui-polish (#70) 2026-01-22 00:17:23 +00:00
InventoryItemResourceTest.php feat/041-inventory-ui (#44) 2026-01-07 17:10:57 +00:00
InventoryPagesTest.php 065-tenant-rbac-v1 (#79) 2026-01-28 21:09:47 +00:00
InventorySyncRunResourceTest.php feat/041-inventory-ui (#44) 2026-01-07 17:10:57 +00:00
LivewireInterceptShimIsLoadedTest.php 057-filament-v5-upgrade (#66) 2026-01-20 21:19:27 +00:00
MalformedSnapshotWarningTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
ODataTypeMismatchTest.php feat/049-backup-restore-job-orchestration (#56) 2026-01-11 15:59:06 +00:00
PolicyCaptureSnapshotOptionsTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
PolicyListingTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
PolicySettingsDisplayTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
PolicySettingsStandardRendersArraysTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
PolicyVersionReadableLayoutTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
PolicyVersionRestoreToIntuneTest.php feat/049-backup-restore-job-orchestration (#56) 2026-01-11 15:59:06 +00:00
PolicyVersionRestoreViaWizardTest.php 065-tenant-rbac-v1 (#79) 2026-01-28 21:09:47 +00:00
PolicyVersionScopeTagsDisplayTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
PolicyVersionSettingsTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
PolicyVersionTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
PolicyViewSettingsCatalogReadableTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
ProviderConnectionsDbOnlyTest.php feat: unify provider connection actions and notifications (#73) 2026-01-25 01:01:37 +00:00
RestoreExecutionTest.php feat/049-backup-restore-job-orchestration (#56) 2026-01-11 15:59:06 +00:00
RestoreItemSelectionTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
RestorePreviewTest.php feat/018-driver-updates-wufb (#27) 2026-01-04 00:38:54 +00:00
RestoreWizardGraphSafetyTest.php feat/048-backup-restore-ui-graph-safety (#55) 2026-01-11 00:14:35 +00:00
ScriptPoliciesNormalizedDisplayTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
SettingsCatalogPolicyHydrationTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
SettingsCatalogPolicyNormalizedDiffTest.php feat(010): Administrative Templates – restore from PolicyVersion + version visibility (#13) 2025-12-30 01:50:05 +00:00
SettingsCatalogPolicyNormalizedDisplayTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
SettingsCatalogPolicySyncTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
SettingsCatalogRestoreApplySettingsPatchTest.php feat/049-backup-restore-job-orchestration (#56) 2026-01-11 15:59:06 +00:00
SettingsCatalogRestoreTest.php feat/049-backup-restore-job-orchestration (#56) 2026-01-11 15:59:06 +00:00
SettingsCatalogSettingsTableRenderTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
TenantActionsAuthorizationTest.php 065-tenant-rbac-v1 (#79) 2026-01-28 21:09:47 +00:00
TenantDashboardDbOnlyTest.php feat(058): tenant dashboard + active-runs gating (#68) 2026-01-21 14:00:42 +00:00
TenantDashboardTenantScopeTest.php 058-tenant-ui-polish (#70) 2026-01-22 00:17:23 +00:00
TenantMakeCurrentTest.php 065-tenant-rbac-v1 (#79) 2026-01-28 21:09:47 +00:00
TenantMembersDbOnlyRenderTest.php 065-tenant-rbac-v1 (#79) 2026-01-28 21:09:47 +00:00
TenantMembersTest.php 065-tenant-rbac-v1 (#79) 2026-01-28 21:09:47 +00:00
TenantPortfolioContextSwitchTest.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
TenantRbacWizardTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
TenantScopingTest.php 065-tenant-rbac-v1 (#79) 2026-01-28 21:09:47 +00:00
TenantSetupTest.php 065-tenant-rbac-v1 (#79) 2026-01-28 21:09:47 +00:00
WindowsUpdateProfilesRestoreTest.php feat/049-backup-restore-job-orchestration (#56) 2026-01-11 15:59:06 +00:00
WindowsUpdateRingPolicyTest.php feat/031-tenant-portfolio-context-switch (#32) 2026-01-04 21:28:08 +00:00
WindowsUpdateRingRestoreTest.php feat/049-backup-restore-job-orchestration (#56) 2026-01-11 15:59:06 +00:00