<?php

declare(strict_types=1);

namespace App\Policies;

use App\Models\AssetDocument;
use App\Models\User;

/**
 * Record-level rules for Asset Documents.
 *
 * Viewing and uploading are open to every signed-in user, matching every
 * other reference-data module. Deletion is master-only — the same shape as
 * AssetWarrantyPolicy.
 */
class AssetDocumentPolicy
{
    public function viewAny(User $actor): bool
    {
        return true;
    }

    public function view(User $actor, AssetDocument $document): bool
    {
        return true;
    }

    public function create(User $actor): bool
    {
        return true;
    }

    public function delete(User $actor, AssetDocument $document): bool
    {
        return $actor->is_master;
    }
}
