You are here

protected function SimpleLdapUserRouteSubscriber::alterRoutes in Simple LDAP 8

Alters existing routes for a specific collection.

Parameters

\Symfony\Component\Routing\RouteCollection $collection: The route collection for adding routes.

Overrides RouteSubscriberBase::alterRoutes

File

modules/simple_ldap_user/src/Routing/SimpleLdapUserRouteSubscriber.php, line 9

Class

SimpleLdapUserRouteSubscriber

Namespace

Drupal\simple_ldap_user\Routing

Code

protected function alterRoutes(RouteCollection $collection) {
  if ($route = $collection
    ->get('user.pass')) {
    $route
      ->setRequirement('_access', 'FALSE');
  }
  if ($route = $collection
    ->get('user.register')) {
    $route
      ->setRequirement('_access', 'FALSE');
  }
}