CheckProvider::setChecks

public CheckProvider::setChecks(RouteCollection $routes)

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);
    }
  }
}
doc_Drupal
2016-10-29 08:49:58
Comments
Leave a Comment

Please login to continue.