示例#1
0
 /**
  * @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
0
 public function checkAccessAction($action)
 {
     return parent::checkAccessAction($action) || $this->actions->dataFieldByName('action_' . $action) || ($field = $this->checkFieldsForAction($this->Fields(), $action) && $field->checkAccessAction($action));
 }
示例#3
0
 /**
  * @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;
 }