What is the equivalent of hook_translated_menu_link_alter() to alter a menu link?
HOOK_link_alter would be one D8 equivalent to hook_translated_menu_link_alter:

/**
 * Implements hook_link_alter().
 *
 * @inheritdoc
 */
function HOOK_link_alter(&amp;$variables) {
  $url = $variables['url'];
  // Check url is routed in Drupal.
  if ($url-&gt;isRouted()) {
    // Load the current user by user ID.
    $currentUser = User::load(\Drupal::currentUser()-&gt;id());
    // Check access.
    $urlAccess = $url-&gt;access();
    // Get url options.
    $urlOptions = $url-&gt;getOptions();
    // Your code here.
  }
}


See Drupal 8 class URL for more API info.

However, you could use Hook_preprocess_HOOK() as such:

/**
 * Implements hook_preprocess_hook().
 *
 * @inheritdoc
 */
function HOOK_preprocess_menu(&amp;$variables) {
  if (isset($variables['menu_name']) &amp;&amp; $variables['menu_name'] === 'menu_name') {
    foreach($variables['items'] as $key =&gt; $item) {
      $url = $item['url']-&gt;toString();
      if ($url == '/user') {
        // Remove menu item.
        unset($variables['items'][$key]);
      }
    }
  }
}


Just checking path above, but it shows you can hide a single menu item based on certain criteria.



For the access restrictions, depending on your needs, you might look at routing and permissions based on the entity instead of the menu item and let Drupal handle the menu item display.

For menu access by role look at this module: https://www.drupal.org/project/menu_item_role_access