protected function CasRouteSubscriber::alterRoutes in CAS 8
Same name and namespace in other branches
- 2.x 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\SubscriberCode
protected function alterRoutes(RouteCollection $collection) {
foreach ([
'user.pass',
'user.pass.http',
] as $route_name) {
$collection
->get($route_name)
->setRequirement('_cas_user_access', 'TRUE');
}
}