TenantAtlas/tests/Feature/Filament
ahmido d1a9989037 feat/066-rbac-ui-enforcement-helper-v2 (#83)
Implementiert Feature 066: “RBAC UI Enforcement Helper v2” inkl. Migration der betroffenen Filament-Surfaces + Regression-Tests.

Was ist drin

Neuer Helper:
UiEnforcement.php: mixed visibility (preserveVisibility, andVisibleWhen, andHiddenWhen), tenant resolver (tenantFromFilament, tenantFromRecord, tenantFrom(callable)), bulk preflight (preflightByCapability, preflightByTenantMembership, preflightSelection) + server-side authorizeOrAbort() / authorizeBulkSelectionOrAbort().
UiTooltips.php: standard Tooltip “Insufficient permission — ask a tenant Owner.”
Filament migrations (weg von Gate::… / abort_* hin zu UiEnforcement):
Backup/Restore (mixed visibility)
TenantResource (record-scoped tenant actions + bulk preflight)
Inventory/Entra/ProviderConnections (Tier-2 surfaces)
Guardrails:
NoAdHocFilamentAuthPatternsTest.php als CI-failing allowlist guard für app/Filament/**.
Verhalten / Contract

Non-member: deny-as-not-found (404) auf tenant routes; Actions hidden.
Member ohne Capability: Action visible but disabled + standard tooltip; keine Ausführung.
Member mit Capability: Action enabled; destructive/high-impact Actions bleiben confirmation-gated (->requiresConfirmation()).
Server-side Enforcement bleibt vorhanden: Mutations/Operations rufen authorizeOrAbort() / authorizeBulkSelectionOrAbort().
Tests

Neue/erweiterte Feature-Tests für RBAC UX inkl. Http::preventStrayRequests() (DB-only render):
BackupSetUiEnforcementTest.php
RestoreRunUiEnforcementTest.php
ProviderConnectionsUiEnforcementTest.php
diverse bestehende Filament Tests erweitert (Inventory/Entra/Tenant actions/bulk)
Unit-Tests:
UiEnforcementTest.php
UiEnforcementBulkPreflightQueryCountTest.php
Verification

vendor/bin/sail bin pint --dirty 
vendor/bin/sail artisan test --compact tests/Unit/Auth tests/Feature/Filament tests/Feature/Guards tests/Feature/Rbac  (185 passed, 5 skipped)
Notes für Reviewer

Filament v5 / Livewire v4 compliant.
Destructive actions: weiterhin ->requiresConfirmation() + server-side auth.
Bulk: authorization preflight ist set-based (Query-count test vorhanden).

Co-authored-by: Ahmed Darrazi <ahmeddarrazi@MacBookPro.fritz.box>
Reviewed-on: #83
2026-01-30 17:28: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 feat/066-rbac-ui-enforcement-helper-v2 (#83) 2026-01-30 17:28:47 +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
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 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