TenantAtlas/tests/Feature/Filament
ahmido 6a86c5901a 066-rbac-ui-enforcement-helper (#81)
Kontext / Ziel
Diese PR standardisiert Tenant‑RBAC Enforcement in der Filament‑UI: statt ad-hoc Gate::*, abort_if/abort_unless und kopierten ->visible()/->disabled()‑Closures gibt es jetzt eine zentrale, wiederverwendbare Implementierung für Actions (Header/Table/Bulk).

Links zur Spec:

spec.md
plan.md
quickstart.md
Was ist drin
Neue zentrale Helper-API: UiEnforcement (Tenant-plane RBAC‑UX “source of truth” für Filament Actions)
Standardisierte Tooltip-Texte und Context-DTO (UiTooltips, TenantAccessContext)
Migration vieler tenant‑scoped Filament Action-Surfaces auf das Standardpattern (ohne ad-hoc Auth-Patterns)
CI‑Guard (Test) gegen neue ad-hoc Patterns in app/Filament/**:
verbietet Gate::allows/denies/check/authorize, use Illuminate\Support\Facades\Gate, abort_if/abort_unless
Legacy-Allowlist ist aktuell leer (neue Verstöße failen sofort)
RBAC-UX Semantik (konsequent & testbar)
Non-member: UI Actions hidden (kein Tenant‑Leak); Execution wird blockiert (Filament hidden→disabled chain), Defense‑in‑depth enthält zusätzlich serverseitige Guards.
Member ohne Capability: Action visible aber disabled + Standard-Tooltip; Execution wird blockiert (keine Side Effects).
Member mit Capability: Action enabled und ausführbar.
Destructive actions: über ->destructive() immer mit ->requiresConfirmation() + klare Warntexte (Execution bleibt über ->action(...)).
Wichtig: In Filament v5 sind hidden/disabled Actions typischerweise “silently blocked” (200, keine Ausführung). Die Tests prüfen daher UI‑State + “no side effects”, nicht nur HTTP‑Statuscodes.

Sicherheit / Scope
Keine neuen DB-Tabellen, keine Migrations, keine Microsoft Graph Calls (DB‑only bei Render; kein outbound HTTP).
Tenant Isolation bleibt Isolation‑Boundary (deny-as-not-found auf Tenant‑Ebene, Capability erst nach Membership).
Kein Asset-Setup erforderlich; keine neuen Filament Assets.
Compliance Notes (Repo-Regeln)
Filament v5 / Livewire v4.0+ kompatibel.
Keine Änderungen an Provider‑Registrierung (Laravel 11+/12: providers.php bleibt der Ort; hier unverändert).
Global Search: keine gezielte Änderung am Global‑Search-Verhalten in dieser PR.
Tests / Qualität
Pest Feature/Unit Tests für Member/Non-member/Tooltip/Destructive/Regression‑Guard.
Guard-Test: “No ad-hoc Filament auth patterns”.
Full suite laut Tasks: vendor/bin/sail artisan test --compact → 837 passed, 5 skipped.
Checklist: requirements.md vollständig (16/16).
Review-Fokus
API‑Usage in neuen/angepassten Filament Actions: UiEnforcement::forAction/forTableAction/forBulkAction(...)->requireCapability(...)->apply()
Guard-Test soll “red” werden, sobald jemand neue ad-hoc Auth‑Patterns einführt (by design).

Co-authored-by: Ahmed Darrazi <ahmeddarrazi@MacBookPro.fritz.box>
Reviewed-on: #81
2026-01-30 16:58:02 +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 066-rbac-ui-enforcement-helper (#81) 2026-01-30 16:58:02 +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 066-rbac-ui-enforcement-helper (#81) 2026-01-30 16:58:02 +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