TenantAtlas/tests/Feature/Filament
ahmido 3490fb9e2c feat: RBAC troubleshooting & tenant UI bugfix pack (spec 067) (#84)
Summary
Implements Spec 067 “RBAC Troubleshooting & Tenant UI Bugfix Pack v1” for the tenant admin plane (/admin) with strict RBAC UX semantics:

Non-member tenant scope ⇒ 404 (deny-as-not-found)
Member lacking capability ⇒ 403 server-side, while the UI stays visible-but-disabled with standardized tooltips
What changed
Tenant view header actions now use centralized UI enforcement (no “normal click → error page” for readonly members).
Archived tenants remain resolvable in tenant-scoped routes for entitled members; an “Archived” banner is shown.
Adds tenant-scoped diagnostics page (/admin/t/{tenant}/diagnostics) with safe repair actions (confirmation + authorization + audit log).
Adds/updates targeted Pest tests to lock the 404 vs 403 semantics and action UX.
Implementation notes
Livewire v4.0+ compliance: Uses Filament v5 + Livewire v4 conventions; widget Blade views render a single root element.
Provider registration: Laravel 11+ providers stay in providers.php (no changes required).
Global search: No global search behavior/resources changed in this PR.
Destructive actions:
Tenant archive/restore/force delete and diagnostics repairs execute via ->action(...) and include ->requiresConfirmation().
Server-side authorization is enforced (non-members 404, insufficient capability 403).
Assets: No new assets. No change to php artisan filament:assets expectations.
Tests
Ran:

vendor/bin/sail bin pint --dirty
vendor/bin/sail artisan test --compact (focused files for Spec 067)

Co-authored-by: Ahmed Darrazi <ahmeddarrazi@MacBookPro.fritz.box>
Reviewed-on: #84
2026-01-31 20:09:25 +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
ArchivedTenantViewTest.php feat: RBAC troubleshooting & tenant UI bugfix pack (spec 067) (#84) 2026-01-31 20:09:25 +00:00
BackupCreationTest.php 015-policy-picker-ux (#21) 2026-01-02 13:59:15 +00:00
BackupItemsBulkRemoveTest.php feat: RBAC troubleshooting & tenant UI bugfix pack (spec 067) (#84) 2026-01-31 20:09:25 +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
BackupSetUiEnforcementTest.php feat/066-rbac-ui-enforcement-helper-v2 (#83) 2026-01-30 17:28:47 +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 feat/066-rbac-ui-enforcement-helper-v2 (#83) 2026-01-30 17:28:47 +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/066-rbac-ui-enforcement-helper-v2 (#83) 2026-01-30 17:28:47 +00:00
InventoryPagesTest.php 065-tenant-rbac-v1 (#79) 2026-01-28 21:09:47 +00:00
InventorySyncRunResourceTest.php feat/066-rbac-ui-enforcement-helper-v2 (#83) 2026-01-30 17:28:47 +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
ProviderConnectionsUiEnforcementTest.php feat/066-rbac-ui-enforcement-helper-v2 (#83) 2026-01-30 17:28:47 +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
RestoreRunUiEnforcementTest.php feat/066-rbac-ui-enforcement-helper-v2 (#83) 2026-01-30 17:28:47 +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 feat/066-rbac-ui-enforcement-helper-v2 (#83) 2026-01-30 17:28: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
TenantDiagnosticsRepairsTest.php feat: RBAC troubleshooting & tenant UI bugfix pack (spec 067) (#84) 2026-01-31 20:09:25 +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 066-rbac-ui-enforcement-helper (#81) 2026-01-30 16:58:02 +00:00
TenantPortfolioContextSwitchTest.php feat/066-rbac-ui-enforcement-helper-v2 (#83) 2026-01-30 17:28:47 +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 feat: RBAC troubleshooting & tenant UI bugfix pack (spec 067) (#84) 2026-01-31 20:09:25 +00:00
TenantViewHeaderUiEnforcementTest.php feat: RBAC troubleshooting & tenant UI bugfix pack (spec 067) (#84) 2026-01-31 20:09:25 +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