You are here

protected function RouteSubscriber::alterRoutes in User protect 8

Alters existing routes for a specific collection.

Parameters

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

Overrides RouteSubscriberBase::alterRoutes

File

src/Routing/RouteSubscriber.php, line 18

Class

RouteSubscriber
Class RouteSubscriber.

Namespace

Drupal\userprotect\Routing

Code

protected function alterRoutes(RouteCollection $collection) {
  if ($route = $collection
    ->get('role_delegation.edit_form')) {
    $route
      ->setRequirement('_userprotect_role_access_check', 'TRUE');
  }
}