library/Storage/Adapter/ArrayAdapter/ArrayAdapter.php
protected function checkRoleResource($role, $resource)
    {
        $resource = $this->checkResource($resource);
        $role = $this->checkRole($role);
        $roleId = ($role->getRoleId() == null) ? StorageInterface::ALL_ROLES : $role->getRoleId();
        $resrcId = ($resource->getResourceId() == null) ? StorageInterface::ALL_RESOURCES : $resource->getResourceId();
        if (!isset($this->permission[$roleId][self::NODE_RESOURCES][$resrcId][self::NODE_PERMISSION])) {
            $this->permission[$roleId][self::NODE_RESOURCES][$resrcId][self::NODE_PERMISSION] = [];
        }

        return $this;
    }
protected function checkRoleResource($role, $resource)
    {
        $resource = $this->checkResource($resource);
        $role = $this->checkRole($role);
        $roleId = ($role->getRoleId() == null) ? StorageInterface::ALL_ROLES : $role->getRoleId();
        $resrcId = ($resource->getResourceId() == null) ? StorageInterface::ALL_RESOURCES : $resource->getResourceId();
        if (!isset($this->permission[$roleId][self::NODE_RESOURCES][$resrcId][self::NODE_PERMISSION])) {
            $this->permission[$roleId][self::NODE_RESOURCES][$resrcId][self::NODE_PERMISSION] = [];
        }

        return $this;
    }
protected function checkRoleResource ( $ role , $ resource ) { $ resource = $ this -> checkResource ( $ resource ) ; $ role = $ this -> checkRole ( $ role ) ; $ roleId = ( $ role -> getRoleId ( ) == null ) ? StorageInterface :: ALL_ROLES : $ role -> getRoleId ( ) ; $ resrcId = ( $ resource -> getResourceId ( ) == null ) ? StorageInterface :: ALL_RESOURCES : $ resource -> getResourceId ( ) ; if ( ! isset ( $ this -> permission [ $ roleId ] [ self :: NODE_RESOURCES ] [ $ resrcId ] [ self :: NODE_PERMISSION ] ) ) { $ this -> permission [ $ roleId ] [ self :: NODE_RESOURCES ] [ $ resrcId ] [ self :: NODE_PERMISSION ] = [ ] ; } return $ this ; }
Check if already exists a resource permission node config, if not exist add it

@param $role
@param $resource
@return $this
Check if already exists a resource permission node config if not exist add it