From cb515a57dbcb66e5a30a46113c827fefbcb8d42e Mon Sep 17 00:00:00 2001 From: Patrick Schilf Date: Wed, 13 Mar 2024 15:55:18 -0300 Subject: [PATCH] Revert "Conditional IoR admin links (IoR roles only)" This reverts commit bf0fe9acb5226c89982b86a61a96471ccadc1c8d. --- custom/modules/ior/ior.links.menu.yml | 13 ------------- custom/modules/ior/ior.module | 20 -------------------- 2 files changed, 33 deletions(-) delete mode 100644 custom/modules/ior/ior.links.menu.yml diff --git a/custom/modules/ior/ior.links.menu.yml b/custom/modules/ior/ior.links.menu.yml deleted file mode 100644 index 173543b8..00000000 --- a/custom/modules/ior/ior.links.menu.yml +++ /dev/null @@ -1,13 +0,0 @@ -system.admin.unblib.ior: - title: Images of Research - description: 'Manage Images of Research contests' - route_name: 'view.ior_contests.page_1' - parent: system.admin.unblib - weight: 100 - -system.admin.unblib.ior.contest: - title: Contests - description: 'Manage contests' - route_name: 'view.ior_contests.page_1' - parent: system.admin.unblib.ior - weight: 0 diff --git a/custom/modules/ior/ior.module b/custom/modules/ior/ior.module index 9b45d485..669bd465 100644 --- a/custom/modules/ior/ior.module +++ b/custom/modules/ior/ior.module @@ -383,23 +383,3 @@ function ior_update_9004(&$sandbox) { ->fields(['bundle' => 'image']) ->execute(); } - -/** - * Implements hook_menu_links_discovered_alter(). - */ -function ior_menu_links_discovered_alter(&$links) { - $user = Drupal::service(('current_user')); - $ior_roles = array_filter($user->getAccount()->getRoles(), function ($role) { - return $role === 'ior_manager' || $role === 'ior_reviewer'; - }); - - if (!count($ior_roles)) { - $ior_link_ids = array_filter(array_keys($links), function ($link_id) { - return preg_match("/^system.admin.unblib.ior/", $link_id); - }); - - foreach ($ior_link_ids as $link_id) { - unset($links[$link_id]); - } - } -}