Check if an action can be dispatched using CRUD.

@return bool|\Cake\Controller\Component The component instance if action is
mapped else `false`.
165476
protected function _isActionMapped()
    {
        if (!empty($this->dispatchComponents)) {
            foreach ($this->dispatchComponents as $component => $enabled) {
                if (empty($enabled)) {
                    continue;
                }

                // Skip if isActionMapped isn't defined in the Component
                if (!method_exists($this->{$component}, 'isActionMapped')) {
                    continue;
                }

                // Skip if the action isn't mapped
                if (!$this->{$component}->isActionMapped()) {
                    continue;
                }

                // Skip if execute isn't defined in the Component
                if (!method_exists($this->{$component}, 'execute')) {
                    continue;
                }

                // Return the component instance.
                return $this->{$component};
            }
        }

        return false;
    }
363540
public function hasGroupAction()
	{
		$condition = $this->datagrid->getRowCondition('group_action');

		return $condition ? $condition($this->item) : true;
	}
1218933
public function isActionValid ()
	{
		return substr ($this->action, 0, 2) !== '__' && !in_array (strtolower ($this->action), $this->invalidActions);
	}
1254659
public function hasAction($key)
	{
		$condition = $this->datagrid->getRowCondition('action', $key);

		return $condition ? $condition($this->item) : true;
	}
101538
public function isEnable()
    {
        if (!$this->mPDFExists() || !$this->collection()->getSize()) {
            return false;
        }

        return $this->hasConfig(self::ENABLE);
    }
886697
public function canBeShowed(): bool
    {
        return ($this->mixed instanceof Collection || $this->mixed instanceof \Countable || is_int($this->mixed));
    }
120644
private function hasFullAccess(): bool
    {
        if (! isset($this->capabilities['action'][Utils::getTypeFull()])) {
            return false;
        }

        // check user capabilities against action's full capabilities
        foreach ($this->capabilities['action'][Utils::getTypeFull()] as $capability) {
            // if current action's full capability is matched in user's capabilities just return
            if (in_array($capability->getName(), $this->capabilities['user'])) {
                return true;
            }
        }

        return false;
    }
762476
protected function _actionCheck()
    {
        $actions = $this->config('actions');
        if (is_bool($actions)) {
            return $actions;
        }
        if (is_string($actions)) {
            $actions = [$actions];
        }
        if(count(array_filter(array_keys($actions), 'is_string')) > 0){
            $_actions = [];
            foreach($actions as $key=>$value){
                if(is_string($key)){
                    $_actions[] = $key;
                } else {
                    $_actions[] = $value;
                }
            }
            $actions = $_actions;
        }
        return in_array($this->request->action, $actions);
    }
702206
public function can_run() {
		// This handler can only run when we have an application defined
		if (class_exists('\\Skeleton\\Core\\Application') === false) {
			return false;
		}
		
		try {
			\Skeleton\Core\Application::get();
			return true;
		} catch (\Exception $e) {};

		return false;
	}
50452
public function actionCallEdit()
    {
        $component = $this->_component;

        if (\Yii::$app->request->get('attributes') && !$settings = \skeeks\cms\models\CmsComponentSettings::findByComponent($component)->one()) {
            $attributes = \Yii::$app->request->get('attributes');
            $component->setAttributes($attributes);
        } else {
            $component->overridePath = [Component::OVERRIDE_DEFAULT];
            $component->refresh();
        }

        if (!\Yii::$app->request->get('callableId')) {
            return $this->redirect(\yii\helpers\Url::to('index') . "?" . http_build_query(\Yii::$app->request->get()));
        }


        return $this->render($this->action->id, [
            'component' => $component,
            'callableId' => \Yii::$app->request->get('callableId'),
        ]);
    }
280679
protected function _actionCheck()
    {
        $actions = $this->getConfig('actions');
        if (is_bool($actions)) {
            return $actions;
        }

        return in_array($this->request->getParam('action'), (array)$actions, true);
    }
874906
public function can($action, $method_code = null, $module_id = null) : bool {
		if (empty($this->controller_id)) return false;
		// module id
		if (empty($module_id)) {
			$module_id = $this->module_id;
			if (empty($module_id)) {
				Throw new \Exception('You must specify correct module #');
			}
		}
		// run permission
		return $this->canExtended($this->controller_id, $method_code ?? $this->method_code, $action, $module_id);
	}
92598
public function IsInternalRequest () {
		if ($this->appRequest === NULL) {
			try {
				$ctrl = $this->GetControllerName();
				$action = $this->GetActionName();
			} catch (\Exception $e) {
				$ctrl = NULL;
				$action = NULL;
			}
			if ($ctrl !== NULL && $action !== NULL) {
				$this->appRequest = FALSE;
				if ($ctrl === 'controller' && $action === 'asset')
					$this->appRequest = TRUE;
			}
		}
		return $this->appRequest;
	}
254579
public function current_action()
    {
        if (isset($_REQUEST['action']) && -1 != $_REQUEST['action']) {
            return $_REQUEST['action'];
        }

        if (isset($_REQUEST['action2']) && -1 != $_REQUEST['action2']) {
            return $_REQUEST['action2'];
        }

        return false;
    }
1099824
protected function hasRole()
    {
        $request = $this->request;
        $role = $this->getAction('is');

        return ! $this->forbiddenRoute() && $request->user()->hasRole($role);
    }
799846
public function hasAllowableAction(Action $action)
    {
        $currentAllowableActions = $this->getAllowableActions();
        if ($currentAllowableActions === null || count($currentAllowableActions->getAllowableActions()) === 0) {
            throw new IllegalStateException('Allowable Actions are not available!');
        }

        return in_array($action, $currentAllowableActions->getAllowableActions(), false);
    }
878923
public function execute()
    {
        try {
            if ($action = $this->action) {
                return $action($this);
            } else {
                foreach ($this->parseSteps as $parseStep) {
                    if (is_string($parseStep)) {
                        $parseStep = [$this->controller, $parseStep];
                    }

                    if ($parseStep($this) === false) {
                        return false;
                    }
                }

                $queryStep = $this->queryStep;
                if (is_string($queryStep)) {
                    $queryStep = [$this->controller, $queryStep];
                }

                $result = $queryStep($this);

                foreach ($this->transformSteps as $transformStep) {
                    if (is_string($transformStep)) {
                        $transformStep = [$this->controller, $transformStep];
                    }

                    if ($transformStep($result, $this) === false) {
                        return false;
                    }
                }
            }
        // handle API exceptions
        } catch (Error\Base $ex) {
            if (method_exists($this->controller, 'handleError')) {
                $this->controller->handleError($ex, $this);
            }
        }

        return true;
    }