<?php

namespace Modules\Identity\Policies;

use App\Models\User;
use Spatie\Activitylog\Models\Activity;

/**
 * The audit trail (T6.2) is read-only from the admin panel — nothing ever
 * creates/edits/deletes an Activity row through Filament, only the
 * LogsActivity trait writes here. Gated by view_audit_log per domain.md §8.
 */
class AuditLogPolicy
{
    public function viewAny(User $user): bool
    {
        return $user->can('view_audit_log');
    }

    public function view(User $user, Activity $activity): bool
    {
        return $user->can('view_audit_log');
    }

    public function create(User $user): bool
    {
        return false;
    }

    public function update(User $user, Activity $activity): bool
    {
        return false;
    }

    public function delete(User $user, Activity $activity): bool
    {
        return false;
    }
}
