remove unecessary gates for users routes and add UserPolicy

This commit is contained in:
2025-12-17 16:52:43 +01:00
parent 4c3647fe30
commit a0e95aca3e
16 changed files with 30 additions and 19 deletions
+2 -11
View File
@@ -3,6 +3,7 @@
namespace App\Providers;
use App\Models\User;
use App\Policies\UserPolicy;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\ServiceProvider;
@@ -21,16 +22,6 @@ class GateServiceProvider extends ServiceProvider
*/
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;
});
Gate::policy(User::class, UserPolicy::class);
}
}