Skip to content
Snippets Groups Projects
Commit f46a4199 authored by Liam Morland's avatar Liam Morland
Browse files

ISTWCMS-4229: Run this alterRoutes() after menu_admin_per_menu's

parent 17eeba3c
No related branches found
No related tags found
1 merge request!63ISTWCMS-4229: Protect home page
......@@ -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;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment