From b1e100b37124ad433a4dd47052bf36ae773cda06 Mon Sep 17 00:00:00 2001 From: Daniel Sasser Date: Mon, 11 Sep 2023 10:36:40 -0700 Subject: [PATCH] VACMS-14793: Adds check for admin. --- .../src/EventSubscriber/FormEventSubscriber.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docroot/modules/custom/va_gov_header_footer/src/EventSubscriber/FormEventSubscriber.php b/docroot/modules/custom/va_gov_header_footer/src/EventSubscriber/FormEventSubscriber.php index 5c93ce6e509..82cc90b497e 100644 --- a/docroot/modules/custom/va_gov_header_footer/src/EventSubscriber/FormEventSubscriber.php +++ b/docroot/modules/custom/va_gov_header_footer/src/EventSubscriber/FormEventSubscriber.php @@ -60,7 +60,8 @@ public static function getSubscribedEvents(): array { public function formAlter(FormAlterEvent $event): void { $form = &$event->getForm(); $formId = $event->getFormId(); - if (in_array($formId, $this->menus)) { + $admin = $this->permsService->hasAdminRole(TRUE); + if (in_array($formId, $this->menus) && $admin) { $this->hideMenuLinkDescriptionField($form); } }