<?php

namespace App\Policies;

use App\Models\Guide;
use App\Models\User;

class GuidePolicy
{
    /**
     * 查看指引列表
     */
    public function viewAny(User $user): bool
    {
        return $user->can('guide.view');
    }

    /**
     * 查看指引
     */
    public function view(User $user, Guide $guide): bool
    {
        return $user->can('guide.view');
    }

    /**
     * 创建指引
     */
    public function create(User $user): bool
    {
        return $user->can('guide.create');
    }

    /**
     * 更新指引
     */
    public function update(User $user, Guide $guide): bool
    {
        return $user->can('guide.update');
    }

    /**
     * 删除指引
     */
    public function delete(User $user, Guide $guide): bool
    {
        return $user->can('guide.delete');
    }

    /**
     * 发布指引
     */
    public function publish(User $user, Guide $guide): bool
    {
        return $user->can('guide.publish');
    }

    /**
     * 归档指引
     */
    public function archive(User $user, Guide $guide): bool
    {
        return $user->can('guide.archive');
    }

    /**
     * 恢复已删除的指引
     */
    public function restore(User $user, Guide $guide): bool
    {
        return $user->can('guide.delete');
    }

    /**
     * 永久删除指引
     */
    public function forceDelete(User $user, Guide $guide): bool
    {
        return $user->can('guide.delete');
    }
}
