isBypassingProgrammedAccessChecks example

return FALSE;
  }

  /** * {@inheritdoc} */
  public function getCacheableArray() {
    return [
      'build_info' => $this->getBuildInfo(),
      'response' => $this->getResponse(),
      'programmed' => $this->isProgrammed(),
      'programmed_bypass_access_check' => $this->isBypassingProgrammedAccessChecks(),
      'process_input' => $this->isProcessingInput(),
      'has_file_element' => $this->hasFileElement(),
      'storage' => $this->getStorage(),
      // Use the properties directly, since self::isCached() combines them and       // cannot be relied upon.       'cache' => $this->cache,
      'no_cache' => $this->no_cache,
    ];
  }

  /** * {@inheritdoc} */
->shouldBeCalled();

    $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setProgrammedBypassAccessCheck($programmed_bypass_access_check));
  }

  /** * @covers ::isBypassingProgrammedAccessChecks * * @dataProvider providerSingleBooleanArgument */
  public function testIsBypassingProgrammedAccessChecks($programmed_bypass_access_check) {
    $this->decoratedFormState->isBypassingProgrammedAccessChecks()
      ->willReturn($programmed_bypass_access_check)
      ->shouldBeCalled();

    $this->assertSame($programmed_bypass_access_check$this->formStateDecoratorBase->isBypassingProgrammedAccessChecks());
  }

  /** * @covers ::setRebuildInfo */
  public function testSetRebuildInfo() {
    $rebuild_info = [
      

  public function setProgrammedBypassAccessCheck($programmed_bypass_access_check = TRUE) {
    $this->decoratedFormState->setProgrammedBypassAccessCheck($programmed_bypass_access_check);

    return $this;
  }

  /** * {@inheritdoc} */
  public function isBypassingProgrammedAccessChecks() {
    return $this->decoratedFormState->isBypassingProgrammedAccessChecks();
  }

  /** * {@inheritdoc} */
  public function setRebuildInfo(array $rebuild_info) {
    $this->decoratedFormState->setRebuildInfo($rebuild_info);

    return $this;
  }

  
// With JavaScript or other easy hacking, input can be submitted even for     // elements with #access=FALSE or #disabled=TRUE. For security, these must     // not be processed. Forms that set #disabled=TRUE on an element do not     // expect input for the element, and even forms submitted with     // self::submitForm() must not be able to get around this. Forms that set     // #access=FALSE on an element usually allow access for some users, so forms     // submitted with self::submitForm() may bypass access restriction and be     // treated as high-privilege users instead.     $process_input = empty($element['#disabled']) &&
      !in_array($element['#type']['item', 'value'], TRUE) &&
      (
        ($form_state->isProgrammed() && $form_state->isBypassingProgrammedAccessChecks()) ||
        ($form_state->isProcessingInput() && (!isset($element['#access']) || (($element['#access'] instanceof AccessResultInterface && $element['#access']->isAllowed()) || ($element['#access'] === TRUE))))
      );

    // Set the element's #value property.     if (!isset($element['#value']) && !array_key_exists('#value', $element)) {
      // @todo Once all elements are converted to plugins in       // https://www.drupal.org/node/2311393, rely on       // $element['#value_callback'] directly.       $value_callable = !empty($element['#value_callback']) ? $element['#value_callback'] : 'form_type_' . $element['#type'] . '_value';
      if (!is_callable($value_callable)) {
        $value_callable = '\Drupal\Core\Render\Element\FormElement::valueCallback';
      }
Home | Imprint | This part of the site doesn't use cookies.