protected function parseActionCondition($condition, $action = null, $renderer = null)
    {
        unset($action);

        if ($renderer === null) {
            $renderer = $this->getActionRenderer();
        }

        if (is_bool($condition)) {
            return $condition;
        } elseif (is_string($condition)) {
            $not = ($condition[0] === '!');
            if ($not) {
                $condition = ltrim($condition, '!');
            }

            $result = null;
            if ($renderer && is_callable([ $renderer, $condition ])) {
                $result = !!$renderer->{$condition}();
            } elseif (is_callable([ $this, $condition ])) {
                $result = !!$this->{$condition}();
            } elseif (is_callable($condition)) {
                $result = !!$condition();
            } elseif ($renderer) {
                $result = !!$renderer->renderTemplate($condition);
            }

            if ($result !== null) {
                return $not ? !$result : $result;
            }
        }

        return $condition;
    }