Skip to content

Commit

Permalink
Revert "Conditional IoR admin links (IoR roles only)"
Browse files Browse the repository at this point in the history
This reverts commit bf0fe9a.
  • Loading branch information
patschilf committed Mar 13, 2024
1 parent 85aa3e3 commit cb515a5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
13 changes: 0 additions & 13 deletions custom/modules/ior/ior.links.menu.yml

This file was deleted.

20 changes: 0 additions & 20 deletions custom/modules/ior/ior.module
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
}
}

0 comments on commit cb515a5

Please sign in to comment.