2025-02-21 05:25:58 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Policies;
|
|
|
|
|
|
|
|
use App\Models\Category;
|
|
|
|
use App\Models\User;
|
|
|
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
2025-02-21 19:35:53 +00:00
|
|
|
use Illuminate\Support\Facades\Auth;
|
2025-02-21 05:25:58 +00:00
|
|
|
|
|
|
|
class CategoryPolicy
|
|
|
|
{
|
|
|
|
use HandlesAuthorization;
|
|
|
|
|
2025-02-24 01:41:50 +00:00
|
|
|
public function viewAny(?User $user): bool
|
2025-02-21 05:25:58 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2025-02-24 01:41:50 +00:00
|
|
|
public function view(?User $user, Category $category): bool
|
2025-02-21 05:25:58 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function create(User $user): bool
|
|
|
|
{
|
2025-02-21 19:35:53 +00:00
|
|
|
return Auth::check();
|
2025-02-21 05:25:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function update(User $user, Category $category): bool
|
|
|
|
{
|
2025-02-21 19:35:53 +00:00
|
|
|
return Auth::check();
|
2025-02-21 05:25:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function delete(User $user, Category $category): bool
|
|
|
|
{
|
2025-02-21 19:35:53 +00:00
|
|
|
return Auth::check();
|
2025-02-21 05:25:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function restore(User $user, Category $category): bool
|
|
|
|
{
|
2025-02-21 19:35:53 +00:00
|
|
|
return Auth::check();
|
2025-02-21 05:25:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function forceDelete(User $user, Category $category): bool
|
|
|
|
{
|
2025-02-21 19:35:53 +00:00
|
|
|
return Auth::check();
|
2025-02-21 05:25:58 +00:00
|
|
|
}
|
|
|
|
}
|