protected function AccessManager::checkAny

Checks access so that at least one checker should allow access.

Parameters

array $checks: Contains the list of checks on the route definition.

\Symfony\Component\Routing\Route $route: The route to check access to.

\Symfony\Component\HttpFoundation\Request $request: The incoming request object.

Return value

bool Returns TRUE if the user has access to the route, else FALSE.

1 call to AccessManager::checkAny()
AccessManager::check in drupal/core/lib/Drupal/Core/Access/AccessManager.php
Checks a route against applicable access check services.

File

drupal/core/lib/Drupal/Core/Access/AccessManager.php, line 164
Contains Drupal\Core\Access\AccessManager.

Class

AccessManager
Attaches access check services to routes and runs them on request.

Namespace

Drupal\Core\Access

Code

protected function checkAny(array $checks, $route, $request) {

  // No checks == deny by default.
  $access = FALSE;
  foreach ($checks as $service_id) {
    if (empty($this->checks[$service_id])) {
      $this
        ->loadCheck($service_id);
    }
    $service_access = $this->checks[$service_id]
      ->access($route, $request);
    if ($service_access === AccessCheckinterface::ALLOW) {
      $access = TRUE;
    }
    if ($service_access === AccessCheckInterface::KILL) {
      return FALSE;
    }
  }
  return $access;
}