<?php

namespace App\Policies;

use App\Models\Order;
use App\Models\User;

class OrderPolicy
{
    public function viewAny(User $user): bool
    {
        return $user->hasPermissionTo('view_orders');
    }

    public function view(User $user, Order $order): bool
    {
        return $user->hasPermissionTo('view_orders');
    }

    public function create(User $user): bool
    {
        return $user->hasPermissionTo('create_orders');
    }

    public function update(User $user, Order $order): bool
    {
        return $user->hasPermissionTo('edit_orders');
    }

    public function delete(User $user, Order $order): bool
    {
        return $user->hasPermissionTo('delete_orders');
    }

    public function deleteAny(User $user): bool
    {
        return $user->hasPermissionTo('delete_orders');
    }
}
