You are here

protected function RouteSubscriber::alterRoutes in Varbase Total Control Dashboard 8

Same name and namespace in other branches
  1. 8.6 src/Routing/RouteSubscriber.php \Drupal\varbase_total_control\Routing\RouteSubscriber::alterRoutes()
  2. 8.5 src/Routing/RouteSubscriber.php \Drupal\varbase_total_control\Routing\RouteSubscriber::alterRoutes()
  3. 9.0.x src/Routing/RouteSubscriber.php \Drupal\varbase_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\varbase_total_control\Routing

Code

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