diff --git a/core/includes/menu.inc b/core/includes/menu.inc
index f7ee143..e31df8e 100644
--- a/core/includes/menu.inc
+++ b/core/includes/menu.inc
@@ -770,17 +770,7 @@ function _menu_translate(&$router_item, $map, $to_arg = FALSE) {
   if (!empty($router_item['route_name'])) {
     $route_provider = Drupal::getContainer()->get('router.route_provider');
     $route = $route_provider->getRouteByName($router_item['route_name']);
-    $request = Request::create('/' . $router_item['href']);
-    $request->attributes->set('system_path', $router_item['href']);
-    // Attempt to match this path to provide a fully built request to the
-    // acccess checker.
-    try {
-      $request->attributes->add(Drupal::service('router.dynamic')->matchRequest($request));
-      $router_item['access'] = Drupal::service('access_manager')->check($route, $request);
-    }
-    catch (NotFoundHttpException $e) {
-      $router_item['access'] = FALSE;
-    }
+    menu_item_route_access($route, $router_item);
   }
   else {
     // @todo: Remove once all routes are converted.
@@ -918,8 +908,7 @@ function _menu_link_translate(&$item, $translate = FALSE) {
     // menu_tree_check_access() may set this ahead of time for links to nodes.
     if (!isset($item['access'])) {
       if ($route = $item->getRoute()) {
-        $request = Request::create('/' . $item['path']);
-        $item['access'] = drupal_container()->get('access_manager')->check($route, $request);
+        menu_item_route_access($route, $item);
       }
       elseif (!empty($item['load_functions']) && !_menu_load_objects($item, $map)) {
         // An error occurred loading an object.
@@ -949,6 +938,30 @@ function _menu_link_translate(&$item, $translate = FALSE) {
 }
 
 /**
+ * Check access to a menu item by mocking a request for a path.
+ *
+ * @param \Symfony\Component\Routing\Route $route
+ *  Router for the given menu item.
+ * @param array $item
+ *   Menu item array as returned by menu_get_item(). The 'access' key of the
+ *   menu item will be updated based on the mock request. To FALSE if user
+ *   access is not possible. TRUE otherwise.
+ */
+function menu_item_route_access($route, &$item) {
+  $request = Request::create('/' . $item['href']);
+  $request->attributes->set('system_path', $item['href']);
+  // Attempt to match this path to provide a fully built request to the
+  // acccess checker.
+  try {
+    $request->attributes->add(Drupal::service('router.dynamic')->matchRequest($request));
+    $item['access'] = Drupal::service('access_manager')->check($route, $request);
+  }
+  catch (NotFoundHttpException $e) {
+    $item['access'] = FALSE;
+  }
+}
+
+/**
  * Gets a loaded object from a router item.
  *
  * menu_get_object() provides access to objects loaded by the current router
