<?php

namespace App\Classes\Modules\Vouchers\Standards\Rules;

use App\Classes\General\Abstracts\AbstractRule;
use Illuminate\Support\Facades\Auth;
use App\Classes\ValueObjects\Constants\RoleTypes;

class CanListVoucherCampaigns extends AbstractRule
{
    /**
     * @param $object
     * @return bool
     */
    protected function authorized($object): bool
    {
        // if (!Auth::user()->can('list voucher campaigns')) {
        if (!in_array(Auth::user()->type, RoleTypes::ADMIN_ROLES)) {
            return false;
        }
        return true;
    }

    /**
     * @param $object
     * @return bool
     * @throws \App\Classes\Exceptions\RequestValidationException
     */
    protected function validators($object): bool
    {
        return true;
    }

    /**
     * @param $object
     * @return bool
     */
    protected function criteria($object): bool
    {
        return true;
    }
}
