Skip to content

Commit

Permalink
#405 - źźź
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofrewak committed Apr 3, 2024
1 parent 01e48a1 commit a3e0011
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 0 additions & 4 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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");
Expand Down
2 changes: 2 additions & 0 deletions bootstrap/providers.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use Spatie\Permission\PermissionServiceProvider;
use Toby\Providers\AppServiceProvider;
use Toby\Providers\AuthServiceProvider;
use Toby\Providers\EventServiceProvider;
Expand All @@ -14,4 +15,5 @@
EventServiceProvider::class,
TelescopeServiceProvider::class,
ObserverServiceProvider::class,
PermissionServiceProvider::class,
];
2 changes: 1 addition & 1 deletion database/seeders/PermissionsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit a3e0011

Please sign in to comment.