From 8943bc06f520f31d7a1e55c4149296d3da2f131a Mon Sep 17 00:00:00 2001 From: calcu1on Date: Sun, 30 Mar 2025 23:13:46 -0400 Subject: [PATCH] Adjusting node access module handler. --- .../src/EventSubscriber/KernelRequestNodePathCheck.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web/modules/custom/nodepath_access/src/EventSubscriber/KernelRequestNodePathCheck.php b/web/modules/custom/nodepath_access/src/EventSubscriber/KernelRequestNodePathCheck.php index 54dceae..8c8a612 100644 --- a/web/modules/custom/nodepath_access/src/EventSubscriber/KernelRequestNodePathCheck.php +++ b/web/modules/custom/nodepath_access/src/EventSubscriber/KernelRequestNodePathCheck.php @@ -7,7 +7,6 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; - /** * Class EntityTypeSubscriber. * @@ -21,7 +20,7 @@ class KernelRequestNodePathCheck implements EventSubscriberInterface { * @return array * The event names to listen for, and the methods that should be executed. */ - public static function getSubscribedEvents() { + public static function getSubscribedEvents(): array { return [ KernelEvents::REQUEST => 'onRequest', ]; @@ -30,7 +29,7 @@ public static function getSubscribedEvents() { /** * React to a config object being saved. */ - public function onRequest(RequestEvent $event) { + public function onRequest(RequestEvent $event): void { $user = \Drupal::currentUser(); $user_roles = $user->getRoles(); if (!in_array('anonymous', $user_roles)) { @@ -39,7 +38,7 @@ public function onRequest(RequestEvent $event) { $current_request = \Drupal::requestStack()->getCurrentRequest(); $path = \Drupal::request()->getRequestUri(); if (str_contains($path, '/node/')) { - /* throw new AccessDeniedHttpException(); */ + throw new AccessDeniedHttpException(); } } }