You are here

protected function RouteSubscriber::alterRoutes in Total Control Admin Dashboard 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Routing/RouteSubscriber.php \Drupal\total_control\Routing\RouteSubscriber::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/Routing/RouteSubscriber.php, line 17

Class

RouteSubscriber
Listens to the dynamic route events.

Namespace

Drupal\total_control\Routing

Code

protected function alterRoutes(RouteCollection $collection) {
  if ($route = $collection
    ->get('page_manager.page_view_total_control_dashboard_total_control_dashboard-http_status_code-0')) {
    $route
      ->setRequirement('_permission', 'have total control');
  }
}