Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. UpdateRouteSubscriber.php

function UpdateRouteSubscriber::alterRoutes

Overrides RouteSubscriberBase::alterRoutes

File

core/modules/update/src/Routing/UpdateRouteSubscriber.php, line 27

Class

UpdateRouteSubscriber
Route subscriber for Update module routes.

Namespace

Drupal\update\Routing

Code

protected function alterRoutes(RouteCollection $collection) {
    if ($this->settings
        ->get('allow_authorize_operations', TRUE)) {
        return;
    }
    $routes = [
        'update.report_update',
        'update.module_update',
        'update.theme_update',
        'update.confirmation_page',
    ];
    foreach ($routes as $route) {
        $route = $collection->get($route);
        $route->setRequirement('_access', 'FALSE');
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal