Add user based bots and policy
All checks were successful
Deploy App / deploy (push) Successful in 9s

This commit is contained in:
2025-08-31 14:27:42 +02:00
parent ed74c14f8d
commit 75be85e608
8 changed files with 69 additions and 78 deletions

View File

@@ -0,0 +1,23 @@
<?php
namespace App\Policies;
use App\Models\Bot;
use App\Models\User;
use Illuminate\Support\Facades\Auth;
class BotPolicy
{
/**
* Create a new policy instance.
*/
public function __construct()
{
return Auth::check();
}
public function view(User $user, Bot $bot): bool
{
return $user->id === $bot->user_id;
}
}