<?php

namespace App\Modules\Payroll\Policies;

use App\Models\User;
use App\Modules\Payroll\Models\PayrollEmployeeSnapshot;

class PayrollEmployeeSnapshotPolicy
{
    public function view(User $user, PayrollEmployeeSnapshot $snapshot): bool
    {
        return $user->can('payroll.payslips.view')
            && (int) $user->tenant_id === (int) $snapshot->tenant_id;
    }
}

