本文整理汇总了PHP中RequestHandler::checkAccessAction方法的典型用法代码示例。如果您正苦于以下问题:PHP RequestHandler::checkAccessAction方法的具体用法?PHP RequestHandler::checkAccessAction怎么用?PHP RequestHandler::checkAccessAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RequestHandler
的用法示例。
在下文中一共展示了RequestHandler::checkAccessAction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkAccessAction
/**
* @param string $action
* @return bool
*/
public function checkAccessAction($action)
{
if (parent::checkAccessAction($action)) {
return true;
}
$actions = $this->getAllActions();
foreach ($actions as $formAction) {
if ($formAction->actionName() === $action) {
return true;
}
}
// Always allow actions on fields
$field = $this->checkFieldsForAction($this->Fields(), $action);
if ($field && $field->checkAccessAction($action)) {
return true;
}
return false;
}
示例2: checkAccessAction
public function checkAccessAction($action)
{
return parent::checkAccessAction($action) || $this->actions->dataFieldByName('action_' . $action) || ($field = $this->checkFieldsForAction($this->Fields(), $action) && $field->checkAccessAction($action));
}
示例3: checkAccessAction
/**
* @param string $action
* @return bool
*/
public function checkAccessAction($action)
{
if (parent::checkAccessAction($action)) {
return true;
}
// Always allow actions which map to buttons. See httpSubmission() for further access checks.
$fields = $this->fields->dataFields() ?: array();
$actions = $this->actions->dataFields() ?: array();
$fieldsAndActions = array_merge($fields, $actions);
foreach ($fieldsAndActions as $fieldOrAction) {
if ($fieldOrAction instanceof FormAction && $fieldOrAction->actionName() === $action) {
return true;
}
}
// Always allow actions on fields
$field = $this->checkFieldsForAction($this->Fields(), $action);
if ($field && $field->checkAccessAction($action)) {
return true;
}
return false;
}