Returns whether a action id is in use by a route. In the worst case this
gets reported by the database constraints but we use this method to
report a proper error message

@param integer $actionId
@return boolean
490161
public function hasAction($actionId)
    {
        $sql = '    SELECT COUNT(method.id) AS cnt
                      FROM fusio_routes_method method
                INNER JOIN fusio_routes routes
                        ON routes.id = method.route_id
                     WHERE routes.status = 1
                       AND method.action = :action_id';

        $count = $this->connection->fetchColumn($sql, [
            'action_id' => $actionId,
        ]);

        return $count > 0;
    }
582318
public ActionResult getActionResult(String actionId) {
        if (actionId == null) {
            return null;
        }
        for (ListIterator<ContentResult> iterator = listIterator(size()); iterator.hasPrevious();) {
            ContentResult contentResult = iterator.previous();
            ActionResult actionResult = contentResult.getActionResult(actionId);
            if (actionResult != null) {
                return actionResult;
            }
        }
        return null;
    }
604513
public function hasAction(int $actionValue): bool
    {
        $count = $this
            ->filter(function (Action $action) use ($actionValue) {
                return $action->action() === $actionValue;
            })
            ->count();

        return $count > 0 ? true : false;
    }
558615
public function has($trackID)
    {
        $absPath = realpath((string)$trackID);
        if(is_dir($absPath) || is_file($absPath)){
            $trackID = PathUtil::createPathID($absPath);
        }
        return isset($this->map[$trackID]) ? true:false;
    }
2711
public function isRoute($route, $active = NULL)
	{
		$this->setActive($active);
		return ($this->request->routeIs($route) ? $this->active : '');
	}
106202
public function isValid($module, $controller, $action) {
		if (!in_array($module, $this->modules, true)) {
			return self::ROUTE_ERR_MODULE;
		}
		$className = EntryUtil::controller($module, $controller);
		if (!Container::getInstance()->has($className)) {
			return self::ROUTE_ERR_CONTROLLER;
		}
		$clazz = Container::getInstance()->get($className);
		if (!method_exists($clazz, $action . 'Action')) {
			return self::ROUTE_ERR_ACTION;
		}
		return self::ROUTE_VALID;
	}
142947
public function setReturnAction($actionId = null)
    {
        if ($actionId === null) {
            $actionId = $this->id;
        }
        if (strpos($actionId, '/') === false) {
            $actionId = $this->controller->getUniqueId() . '/' . $actionId;
        }
        $sessionKey = '__adminReturnAction';
        Yii::$app->getSession()->set($sessionKey, $actionId);
    }
208205
public static function has_action( $path, $action = null ) 
	{
		$path = CCStr::cut( $path, '@' );
		$path = CCStr::cut( $path, '?' );
		
		// fix closure given
		if ( !is_string( $path ) )
		{
			return false;	
		}
		
		// get controllers default action
		if ( is_null( $action ) ) 
		{
			$action = static::$_default_action;
		}
		
		// try to load the controller
		if ( !$controller = static::create( $path ) ) 
		{
			return false;
		}
		
		return method_exists( $controller, static::$_action_prefix.$action );
	}
307902
public function userAllowed($action)
    {
        if (user()->isAdmin()) {
            return true;
        }

        $this->_loadPermissions();
        $allowedRoles = $this->_permissions
            ->filter(function ($rule) use ($action) {
                return $rule->get('action') == $action;
            })
            ->extract('role_id')
            ->toArray();
        $intersect = array_intersect($allowedRoles, user()->get('role_ids'));

        return !empty($intersect);
    }
1131085
protected function currentAction()
    {
        $action = substr($action = Route::currentRouteAction(), strpos($action, '@') + 1);

        if (!method_exists($this, $action)) {
            $action = 'index';
        }

        return $action;
    }
287288
public function getCallByRequestId($requestId)
    {
        /* @var $registration \Thruway\Registration */
        foreach ($this->registrations as $registration) {
            $call = $registration->getCallByRequestId($requestId);
            if ($call) {
                return $call;
            }
        }

        return false;
    }
449419
public function detectId()
    {
        // If there is an id, it will be the last number
        if (preg_match('#\d+$#', $this->path, $matches)) {
            return $matches[0];
        }

        // .. or the route will be an action preceeded by an id
        $pattern = '#(\d+)/('.implode('|', $this->actions).')$#i';
        if (preg_match($pattern, $this->path, $matches)) {
            return $matches[1];
        }

        // There's no id
        return false;
    }
865903
private function isLoginPage(Action $action): bool
    {
        $loginUrl = trim(Url::to(Yii::$app->user->loginUrl), '/');

        if (Yii::$app->user->isGuest && $action->getUniqueId() === $loginUrl) {
            return true;
        }

        return false;
    }
1292743
public function isValid($action) {
		$authCtrl=$this->_getAuthController();
		$isValid=$authCtrl->_isValidUser($action);
		if(!$isValid){
			$authCtrl->_autoConnect();
			return $authCtrl->_isValidUser($action);
		}
		return $isValid;
	}
534047
public function getAction($id)
    {
        $id = (integer)$id;
        foreach ($this->actions as $action) {
            if ($id === $action->getId()) {
                return $action;
            }
        }
        return null;
    }
1298844
public function actionIsValidationExempt($action)
    {
        // Non-actions don't bypass validation
        if (!$action) {
            return false;
        }
        if ($action->getValidationExempt()) {
            return true;
        }
        if (in_array($action->actionName(), $this->getValidationExemptActions())) {
            return true;
        }
        return false;
    }
770326
function isCurrentAction( $actionName, $view = '' )
    {
        if ( $view == '' )
            $view = self::currentView();
        if ( $view == '' or $actionName == '' )
            return false;
        return $this->currentAction( $view ) == $actionName;
    }