class UpdateRouteSubscriber

Same name in other branches
  1. 11.x core/modules/update/src/Routing/UpdateRouteSubscriber.php \Drupal\update\Routing\UpdateRouteSubscriber

Route subscriber for Update module routes.

Hierarchy

  • class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of UpdateRouteSubscriber

1 string reference to 'UpdateRouteSubscriber'
update.services.yml in core/modules/update/update.services.yml
core/modules/update/update.services.yml
1 service uses UpdateRouteSubscriber
update.route_subscriber in core/modules/update/update.services.yml
Drupal\update\Routing\UpdateRouteSubscriber

File

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

Namespace

Drupal\update\Routing
View source
class UpdateRouteSubscriber extends RouteSubscriberBase {
    
    /**
     * Constructs a new UpdateRouteSubscriber.
     */
    public function __construct(Settings $settings) {
    }
    
    /**
     * {@inheritdoc}
     */
    protected function alterRoutes(RouteCollection $collection) {
        if ($this->settings
            ->get('allow_authorize_operations', TRUE)) {
            return;
        }
        $routes = [
            'update.report_install',
            'update.report_update',
            'update.module_install',
            'update.module_update',
            'update.theme_install',
            'update.theme_update',
            'update.confirmation_page',
        ];
        foreach ($routes as $route) {
            $route = $collection->get($route);
            $route->setRequirement('_access', 'FALSE');
        }
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
RouteSubscriberBase::getSubscribedEvents public static function 9
RouteSubscriberBase::onAlterRoutes public function Delegates the route altering to self::alterRoutes(). 1
UpdateRouteSubscriber::alterRoutes protected function Alters existing routes for a specific collection. Overrides RouteSubscriberBase::alterRoutes
UpdateRouteSubscriber::__construct public function Constructs a new UpdateRouteSubscriber.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.