<?php

namespace Modules\Payroll\Policies;

use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;

class EmployeesAdvancePolicy
{
    use HandlesAuthorization;

    /**
     * Determine whether the user can view any models.
     */
    public function viewAny(User $user)
    {
        return $user->can('payroll.setting.view')
            || $user->can('payroll.employees-advance.approved');
    }

    public function approved(User $user): bool
    {
        return $user->can('payroll.employees-advance.approved');
    }
}
