You are here

public function RouteSubscriber::alterRoutes in Filter Permissions 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 16

Class

RouteSubscriber
Listens to the dynamic route events.

Namespace

Drupal\filter_perms\Routing

Code

public function alterRoutes(RouteCollection $collection) {
  if ($route = $collection
    ->get('user.admin_permissions')) {
    $route
      ->setDefault('_form', '\\Drupal\\filter_perms\\Form\\PermissionsForm');
  }
  if ($route = $collection
    ->get('entity.user_role.edit_permissions_form')) {
    $route
      ->setDefault('_form', '\\Drupal\\filter_perms\\Form\\PermissionsRoleSpecificForm');
  }
}