add gates for users routes

This commit is contained in:
2025-12-17 16:14:19 +01:00
parent ae81344fe2
commit 4c3647fe30
5 changed files with 49 additions and 7 deletions
+36
View File
@@ -0,0 +1,36 @@
<?php
namespace App\Providers;
use App\Models\User;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\ServiceProvider;
class GateServiceProvider extends ServiceProvider
{
/**
* Register services.
*/
public function register(): void
{
//
}
/**
* Bootstrap services.
*/
public function boot(): void
{
Gate::define('me', function (User $user) {
return true;
});
Gate::define('getUserTasks', function (User $user) {
return true;
});
Gate::define('searchUsers', function (User $user) {
return true;
});
}
}