You are here

public function CheckProvider::setChecks in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Access/CheckProvider.php \Drupal\Core\Access\CheckProvider::setChecks()

For each route, saves a list of applicable access checks to the route.

Parameters

\Symfony\Component\Routing\RouteCollection $routes: A collection of routes to apply checks to.

Overrides CheckProviderInterface::setChecks

File

core/lib/Drupal/Core/Access/CheckProvider.php, line 82

Class

CheckProvider
Loads access checkers from the container.

Namespace

Drupal\Core\Access

Code

public function setChecks(RouteCollection $routes) {
  $this
    ->loadDynamicRequirementMap();
  foreach ($routes as $route) {
    if ($checks = $this
      ->applies($route)) {
      $route
        ->setOption('_access_checks', $checks);
    }
  }
}