<?php

namespace App\Modules\HR\Departments\Policies;

use App\Models\User;
use App\Modules\HR\Departments\Models\Department;

class DepartmentPolicy
{
    public function viewAny(User $user): bool
    {
        return $user->can('departments.view');
    }

    public function view(User $user, Department $department): bool
    {
        return $user->can('departments.view', $department);
    }

    public function create(User $user): bool
    {
        return $user->can('departments.create');
    }

    public function update(User $user, Department $department): bool
    {
        return $user->can('departments.update', $department);
    }

    public function delete(User $user, Department $department): bool
    {
        return $user->can('departments.delete', $department);
    }

    public function deleteAny(User $user): bool
    {
        return $user->can('departments.delete');
    }
}
