Files
Scheduler/app/Policies/BotPolicy.php
Oskar-Mikael 75be85e608
All checks were successful
Deploy App / deploy (push) Successful in 9s
Add user based bots and policy
2025-08-31 14:27:42 +02:00

24 lines
370 B
PHP

<?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;
}
}