<?php

namespace App\Modules\Customization\CustomFields\Policies;

use App\Models\User;
use App\Modules\Customization\CustomFields\Models\CustomField;

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

    public function view(User $user, CustomField $field): bool
    {
        return $user->can('custom_fields.view', $field);
    }

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

    public function update(User $user, CustomField $field): bool
    {
        return $user->can('custom_fields.update', $field);
    }

    public function deactivate(User $user, CustomField $field): bool
    {
        return $user->can('custom_fields.deactivate', $field);
    }
}
