<?php

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


use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\ValueObjects\Constants\RoleTypes;

class CanExportPackingList extends AbstractRule
{

    /**
     * @return bool
     */
    protected function authorized($object): bool
    {
        if(Auth()->user()){
            $roleToCheck = Auth()->user()->type;
            if (in_array($roleToCheck, RoleTypes::ADMIN_ROLES)) {
                return true;
            }
            else {
                return false;
            }
        }
        return false;
    }

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

    }


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

}
