<?php

namespace Mehrab\Comment\Policies;

use Illuminate\Auth\Access\HandlesAuthorization;
use Mehrab\RolePermission\Models\Permission;
use Mehrab\User\Models\User;

class CommentServicePolicy
{
    use HandlesAuthorization;

    /**
     * Create a new policy instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }


    public function index(User $user){
        return $user->hasAnyPermission([Permission::PERMISSION_MANAGE_COMMENT,Permission::PERMISSION_EXPERT]);
    }

    public function status(User $user){
        return $user->hasPermissionTo(Permission::PERMISSION_MANAGE_COMMENT);
    }

    public function delete(User $user){
        return $user->hasPermissionTo(Permission::PERMISSION_MANAGE_COMMENT);
    }
}
