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:
@@ -33,8 +33,8 @@ class AppServiceProvider extends ServiceProvider
|
||||
|
||||
// Authorization gates
|
||||
\Illuminate\Support\Facades\Gate::define('access-ops', function ($user) {
|
||||
// Allow admin users to access ops
|
||||
return $user->is_admin === true;
|
||||
// Allow admin users to access ops (flexible type check)
|
||||
return $user && $user->is_admin;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user