fix: Use flexible type check for is_admin authorization gate

Change strict equality check (=== true) to loose check that works with
both integer 1 and boolean true values.
This commit is contained in:
twotalesanimation
2026-01-02 21:10:26 +02:00
parent 4a8b4ddac2
commit 66862df44b
+2 -2
View File
@@ -33,8 +33,8 @@ class AppServiceProvider extends ServiceProvider
// Authorization gates // Authorization gates
\Illuminate\Support\Facades\Gate::define('access-ops', function ($user) { \Illuminate\Support\Facades\Gate::define('access-ops', function ($user) {
// Allow admin users to access ops // Allow admin users to access ops (flexible type check)
return $user->is_admin === true; return $user && $user->is_admin;
}); });
} }
} }