You are here

public function UncacheableTestAccessResult::isForbidden in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Access/AccessResultTest.php \Drupal\Tests\Core\Access\UncacheableTestAccessResult::isForbidden()
  2. 9 core/tests/Drupal/Tests/Core/Access/AccessResultTest.php \Drupal\Tests\Core\Access\UncacheableTestAccessResult::isForbidden()

Checks whether this access result indicates access is explicitly forbidden.

This is a kill switch — both orIf() and andIf() will result in isForbidden() if either results are isForbidden().

Return value

bool When TRUE then isAllowed() and isNeutral() are FALSE.

Overrides AccessResultInterface::isForbidden

2 calls to UncacheableTestAccessResult::isForbidden()
UncacheableTestAccessResult::andIf in core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
Combine this access result with another using AND.
UncacheableTestAccessResult::orIf in core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
Combine this access result with another using OR.

File

core/tests/Drupal/Tests/Core/Access/AccessResultTest.php, line 1002
Contains \Drupal\Tests\Core\Access\AccessResultTest.

Class

UncacheableTestAccessResult

Namespace

Drupal\Tests\Core\Access

Code

public function isForbidden() {
  return $this->value === 'FORBIDDEN';
}