@param string $resource
@param string $action

@return array
357357
protected function getHttpRequestHeaders($resource, $action)
    {
        $headers = parent::getHttpRequestHeaders($resource, $action);
        $headers['Authorization'] = $this->token;

        return $headers;
    }
494478
public function can($action, $resource = null, $resourceId = null)
    {
        $this->assertLockInstanceIsSet();

        return $this->lock->can($action, $resource, $resourceId);
    }
193782
public function load($resource, $type = null): array
    {
        try {
            $path = $this->locator->locate($resource);
            $file = $this->filesystem->openFile($path);
            $configValues = $this->yamlParser->parse($file->getContents());

            return $configValues;
        } catch (FileLocatorFileNotFoundException $error) {
            return [];
        }
    }
31314
public static function toArray($resource) {
		if (self::isArray($resource)) {
			return $resource;

		} else if (self::isObject($resource)) {
			return self::buildArray($resource);

		} else if (self::isJson($resource)) {
			return json_decode($resource, true);

		} else if ($ser = self::isSerialized($resource)) {
			return self::toArray($ser);

		} else if ($xml = self::isXml($resource)) {
			return self::xmlToArray($xml);
		}

		return $resource;
	}
1266674
public function can($action, $resource, $resourceValue = null)
    {
        if (is_object($resource)) {
            $resourceValue = $resource;
            $resource = get_classname($resourceValue);
        } elseif (is_array($resource)) {
            // Nested resources can be passed through an associative array, this way conditions which are
            // dependent upon the association will work when using a class.
            $resourceValue = head(array_values($resource));
            $resource = head(array_keys($resource));
        }

        // The conditional callback (Closure) is only evaluated when an actual instance object is present.
        // It is not evaluated when checking permissions on the class name (such as in the 'index' action).
        $skipConditions = false;
        if (is_string($resource) && ! is_object($resourceValue) && $this->hasCondition($action, $resource)) {
            $skipConditions = true;
        }

        $self = $this;
        $rules = $this->getRulesFor($action, $resource);

        if (! $rules->isEmpty()) {
            $allowed = array_reduce($rules->all(), function ($result, $rule) use ($self, $resourceValue, $skipConditions) {
                if ($skipConditions) {
                    return $rule->getBehavior(); // Short circuit
                } else {
                    if ($rule->isRestriction()) {
                        // 'deny' rules override prior rules.
                        $result = $result && $rule->isAllowed($self, $resourceValue);
                    } else {
                        // 'allow' rules do not override prior rules but instead are logically or'ed.
                        // Unlike Authority default behavior.
                        $result =  $result || $rule->isAllowed($self, $resourceValue);
                    }
                }

                return $result;
            }, false);
        } else {
            $allowed = false;
        }

        return $allowed;
    }
55905
private function getResourceData($resource)
    {
        $data = false;
        if(!is_null($resource) && $resource->exists()) {
            $resourceTypes = array_keys($resource->getTypes());
            $data = [
                'uri'        => $resource->getUri(),
                'classUri'   => $resourceTypes[0],
                'label'      => $resource->getLabel(),
                'type'       => 'instance'
            ];
        }
        return $data;
    }
635671
public function isRelevant($action, $resource)
    {
        // Nested resources can be passed through a associative array, this way conditions which are
        // dependent upon the association will work when using a class.
        $resource = is_array($resource) ? head(array_keys($resource)) : $resource;
        return parent::isRelevant($action, $resource);
    }
328696
public function getPositionByName($controller, $action = null)
    {
        if ($action === null) {
            list($controller, $action) = explode('.', $controller);
        }
        return array_search("{$controller}.{$action}", $this->action_names);
    }
126271
public function action($action)
    {
        $a = func_get_args();
        $controllerPath = $this->controller->getControllerActionPath();
        array_unshift($a, $controllerPath);
        $ret = call_user_func_array([$this, 'url'], $a);

        return $ret;
    }
380734
public function getJsActionsAllowed($profile, $resource, $actions)
    {
        $actionsAllowed = '[';
        $flag = false;
        foreach ($actions as $action)
        {
            if(parent::isAllowed($profile, $resource, $action->id_008))
            {
                if($flag) $actionsAllowed .= ',';
                $actionsAllowed .= '"' . $action->id_008 . '"';
                $flag =true;
            }
        }
        
        $actionsAllowed .= ']';
        return $actionsAllowed;    
    }
89707
public function getByAction($action)
    {
        return isset($this->actions[$action]) ? $this->actions[$action] : null;
    }
548640
protected function matchTypeAndDestination($action)
    {
        if (preg_match('#^([a-zA-Z0-9_]+):(.+)?$#', $action, $matches)) {
            $actionType = $matches[1];
            $actionValue = isset($matches[2]) ? $matches[2] : false;

            switch ($actionType) {
                case 'eznode':
                    $type = UrlAlias::LOCATION;
                    $destination = $actionValue;
                    break;

                case 'module':
                    $type = UrlAlias::RESOURCE;
                    $destination = $actionValue;
                    break;

                case 'nop':
                    $type = UrlAlias::VIRTUAL;
                    $destination = null;
                    break;

                default:
                    // @todo log message
                    throw new \RuntimeException("Action type '{$actionType}' is unknown");
            }
        } else {
            // @todo log message
            throw new \RuntimeException("Action '{$action}' is not valid");
        }

        return array($type, $destination);
    }
281792
protected function parseConditionParams(array $action): array
    {
        if (empty($this->condition)) {
            return [];
        }

        $params = Arr::first($action, function ($value, $key) {
            return is_numeric($key);
        });

        return [$params];
    }
723794
protected function compileAction($action)
    {
        if (is_null($action)) {
            return $this->attributes;
        }

        if (is_string($action) || $action instanceof Closure) {
            $action = ['uses' => $action];
        }

        return array_merge($this->attributes, $action);
    }
59285
protected function convertToControllerAction($action)
    {
        if (is_string($action)) {
            $action = ['uses' => $action];
        }
        
        // Here we'll merge any group "uses" statement if necessary so that the action
        // has the proper clause for this property. Then we can simply set the name
        // of the controller on the action and return the action array for usage.
        if (! empty($this->groupStack)) {
            $action['uses'] = $this->prependGroupUses($action['uses']);
        }
        
        // Here we will set this controller name on the action array just so we always
        // have a copy of it for reference if we need it. This can be used while we
        // search for a controller name or do some other type of fetch operation.
        $action['controller'] = $action['uses'];
        
        return $action;
    }
491559
protected function action($action)
    {
        $action = in_array($action, $this->actions) ? $action : null;
        $action = array_key_exists($action, $this->aliases) ? $this->aliases[$action] : $action;

        return $action;
    }
1350022
protected function resolvePermissions($action, Resource $resource)
    {
        $permissions = $this->getInheritedRolePermissions($this->role);

        // Search for restrictions in the permissions. We'll do this first
        // because restrictions should override any privileges.
        if (! $this->resolveRestrictions($permissions, $action, $resource)) {
            return false;
        }

        // If there are restrictions on the roles but caller specific privileges are set, allow this to pass.
        return $this->resolvePrivileges($permissions, $action, $resource);
    }