You are here

protected function CasRouteSubscriber::alterRoutes in CAS 2.x

Same name and namespace in other branches
  1. 8 src/Subscriber/CasRouteSubscriber.php \Drupal\cas\Subscriber\CasRouteSubscriber::alterRoutes()

Alters existing routes for a specific collection.

Parameters

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

Overrides RouteSubscriberBase::alterRoutes

File

src/Subscriber/CasRouteSubscriber.php, line 16

Class

CasRouteSubscriber
Alters the user password reset routes.

Namespace

Drupal\cas\Subscriber

Code

protected function alterRoutes(RouteCollection $collection) {
  foreach ([
    'user.pass',
    'user.pass.http',
  ] as $route_name) {
    $collection
      ->get($route_name)
      ->setRequirement('_cas_user_access', 'TRUE');
  }
}