1. 8.5.x core/lib/Drupal/Core/Access/DefaultAccessCheck.php DefaultAccessCheck
  2. 8.0.x core/lib/Drupal/Core/Access/DefaultAccessCheck.php DefaultAccessCheck
  3. 8.1.x core/lib/Drupal/Core/Access/DefaultAccessCheck.php DefaultAccessCheck
  4. 8.2.x core/lib/Drupal/Core/Access/DefaultAccessCheck.php DefaultAccessCheck
  5. 8.3.x core/lib/Drupal/Core/Access/DefaultAccessCheck.php DefaultAccessCheck
  6. 8.4.x core/lib/Drupal/Core/Access/DefaultAccessCheck.php DefaultAccessCheck
  7. 8.6.x core/lib/Drupal/Core/Access/DefaultAccessCheck.php DefaultAccessCheck

Allows access to routes to be controlled by an '_access' boolean parameter.

Hierarchy

Expanded class hierarchy of DefaultAccessCheck

2 files declare their use of DefaultAccessCheck
AccessManagerTest.php in core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php
Contains \Drupal\Tests\Core\Access\AccessManagerTest.
DefaultAccessCheckTest.php in core/tests/Drupal/Tests/Core/Access/DefaultAccessCheckTest.php
1 string reference to 'DefaultAccessCheck'
core.services.yml in core/core.services.yml
core/core.services.yml

File

core/lib/Drupal/Core/Access/DefaultAccessCheck.php, line 11

Namespace

Drupal\Core\Access
View source
class DefaultAccessCheck implements RoutingAccessInterface {

  /**
   * Checks access to the route based on the _access parameter.
   *
   * @param \Symfony\Component\Routing\Route $route
   *   The route to check against.
   *
   * @return \Drupal\Core\Access\AccessResultInterface
   *   The access result.
   */
  public function access(Route $route) {
    if ($route
      ->getRequirement('_access') === 'TRUE') {
      return AccessResult::allowed();
    }
    elseif ($route
      ->getRequirement('_access') === 'FALSE') {
      return AccessResult::forbidden();
    }
    else {
      return AccessResult::neutral();
    }
  }

}

Members

Contains filters are case sensitive
Namesort descending Modifiers Type Description Overrides
DefaultAccessCheck::access public function Checks access to the route based on the _access parameter.