diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 8cc0ff7d..659f70d6 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -8,7 +8,6 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Inertia\Response; -use Spatie\Permission\Models\Permission; use Toby\Actions\CreateUserAction; use Toby\Actions\SyncUserPermissionsWithRoleAction; use Toby\Actions\UpdateUserAction; @@ -26,9 +25,6 @@ class UserController extends Controller */ public function index(Request $request): Response { - /** @var User $user */ - $user = $request->user(); - $this->authorize("manageUsers"); $searchText = $request->query("search"); diff --git a/bootstrap/providers.php b/bootstrap/providers.php index 2730238c..4ea6c18c 100644 --- a/bootstrap/providers.php +++ b/bootstrap/providers.php @@ -2,6 +2,7 @@ declare(strict_types=1); +use Spatie\Permission\PermissionServiceProvider; use Toby\Providers\AppServiceProvider; use Toby\Providers\AuthServiceProvider; use Toby\Providers\EventServiceProvider; @@ -14,4 +15,5 @@ EventServiceProvider::class, TelescopeServiceProvider::class, ObserverServiceProvider::class, + PermissionServiceProvider::class, ]; diff --git a/database/seeders/PermissionsSeeder.php b/database/seeders/PermissionsSeeder.php index 2b523570..00d6cde5 100644 --- a/database/seeders/PermissionsSeeder.php +++ b/database/seeders/PermissionsSeeder.php @@ -20,7 +20,7 @@ public function run(): void $permissions = Permission::all(); foreach ($permissions as $permission) { - if (!in_array($permission->name, $configPermissions, true)) { + if (!in_array($permission->name, $configPermissions, strict: true)) { $permission->delete(); } }