make OrganizationPolicy use “organizations:update” to remove jetstream inconsistencies

The frontend did not show organization settings for admin users because of the team ownership check
This commit is contained in:
Gregor Vostrak
2026-02-17 14:35:52 +01:00
parent f1d001e03e
commit 435522b502
4 changed files with 128 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ namespace App\Policies;
use App\Models\Organization;
use App\Models\User;
use App\Service\PermissionStore;
use Filament\Facades\Filament;
use Illuminate\Auth\Access\HandlesAuthorization;
@@ -58,7 +59,7 @@ class OrganizationPolicy
return true;
}
return $user->ownsTeam($organization);
return app(PermissionStore::class)->userHas($organization, $user, 'organizations:update');
}
/**