diff --git a/src/Routing/UwNodeAccessRouteSubscriber.php b/src/Routing/UwNodeAccessRouteSubscriber.php index d5309c69fe257f4c71aa0fda8cb7e26e726d9c83..b74c3eb801618cfc29693b96c5a9013bedf64e2f 100644 --- a/src/Routing/UwNodeAccessRouteSubscriber.php +++ b/src/Routing/UwNodeAccessRouteSubscriber.php @@ -3,6 +3,7 @@ namespace Drupal\uw_cfg_common\Routing; use Drupal\Core\Routing\RouteSubscriberBase; +use Drupal\Core\Routing\RoutingEvents; use Symfony\Component\Routing\RouteCollection; /** @@ -18,6 +19,15 @@ class UwNodeAccessRouteSubscriber extends RouteSubscriberBase { if ($route = $collection->get('entity.node.canonical')) { $route->setRequirement('_custom_access', 'Drupal\uw_cfg_common\Access\UwNodeAccessCheck::access'); } + + /** + * {@inheritdoc} + */ + public static function getSubscribedEvents(): array { + // Run this implementation of alterRoutes() after menu_admin_per_menu, which + // has priority -220. + $events[RoutingEvents::ALTER] = ['onAlterRoutes', -300]; + return $events; } }