<?php

namespace App\Policies;

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

class ActivityLogPolicy
{
    /**
     * 查看操作日志列表
     */
    public function viewAny(User $user): bool
    {
        return $user->can('activity-log.view');
    }

    /**
     * 查看操作日志详情
     */
    public function view(User $user, Activity $activity): bool
    {
        return $user->can('activity-log.view');
    }

    /**
     * 导出操作日志
     */
    public function export(User $user): bool
    {
        return $user->can('activity-log.export');
    }
}
