HoshiAI-be/app/Policies/CategoryPolicy.php
2025-11-10 22:47:08 +01:00

35 lines
687 B
PHP

<?php
namespace App\Policies;
use App\Models\Category;
use App\Models\User;
use Illuminate\Auth\Access\Response;
class CategoryPolicy
{
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return $user->type === 'admin';
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Category $category): bool
{
return $user->type === 'admin';
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Category $category): bool
{
return $user->type === 'admin';
}
}