diff --git a/core/update.php b/core/update.php
index 3052584..b1a41b3 100644
--- a/core/update.php
+++ b/core/update.php
@@ -340,7 +340,7 @@ function update_access_denied_page() {
  *   TRUE if the current user should be granted access, or FALSE otherwise.
  */
 function update_access_allowed() {
-  global $user;
+    $account = \Drupal::request()->attributes->get('_account');
 
   // Allow the global variable in settings.php to override the access check.
   if (settings()->get('update_free_access')) {
@@ -358,7 +358,7 @@ function update_access_allowed() {
     return user_access('administer software updates');
   }
   catch (\Exception $e) {
-    return ($user->id() == 1);
+    return ($account->id() == 1);
   }
 }
 
