diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php
index 42b565f..1c7d554 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php
@@ -19,6 +19,13 @@
 abstract class AutocompleteWidgetBase extends WidgetBase {
 
   /**
+   * Current user object.
+   *
+   * @var \Drupal\Core\Session\AccountInterface
+   */
+  protected $currentUser;
+
+  /**
    * {@inheritdoc}
    */
   public function settingsForm(array $form, array &$form_state) {
@@ -71,7 +78,7 @@ public function settingsSummary() {
    * {@inheritdoc}
    */
   public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
-    global $user;
+    $user = $this->currentUser();
 
     $entity = $items->getEntity();
 
@@ -195,4 +202,16 @@ protected function getSelectionHandlerSetting($setting_name) {
     return isset($settings[$setting_name]) ? $settings[$setting_name] : NULL;
   }
 
+  /**
+   * Gets the current active user.
+   *
+   * @return \Drupal\Core\Session\AccountInterface
+   */
+  protected function currentUser() {
+    if (!$this->currentUser) {
+      $this->currentUser = \Drupal::currentUser();
+    }
+    return $this->currentUser;
+  }
+
 }
diff --git a/core/modules/options/lib/Drupal/options/Plugin/field/widget/OptionsWidgetBase.php b/core/modules/options/lib/Drupal/options/Plugin/field/widget/OptionsWidgetBase.php
index 2301789..3c567b3 100644
--- a/core/modules/options/lib/Drupal/options/Plugin/field/widget/OptionsWidgetBase.php
+++ b/core/modules/options/lib/Drupal/options/Plugin/field/widget/OptionsWidgetBase.php
@@ -43,6 +43,13 @@
   protected $column;
 
   /**
+   * Current user object.
+   *
+   * @var \Drupal\Core\Session\AccountInterface
+   */
+  protected $currentUser;
+
+  /**
    * {@inheritdoc}
    */
   public function __construct($plugin_id, array $plugin_definition, FieldDefinitionInterface $field_definition, array $settings) {
@@ -123,7 +130,7 @@ public static function validateElement(array $element, array &$form_state) {
   protected function getOptions(FieldItemInterface $item) {
     if (!isset($this->options)) {
       // Limit the settable options for the current user account.
-      $options = $item->getSettableOptions(\Drupal::currentUser());
+      $options = $item->getSettableOptions($this->currentUser());
 
       // Add an empty option if the widget needs one.
       if ($empty_option = $this->getEmptyOption()) {
@@ -232,4 +239,16 @@ static protected function sanitizeLabel(&$label) {
    */
   protected function getEmptyOption() { }
 
+  /**
+   * Gets the current active user.
+   *
+   * @return \Drupal\Core\Session\AccountInterface
+   */
+  protected function currentUser() {
+    if (!$this->currentUser) {
+      $this->currentUser = \Drupal::currentUser();
+    }
+    return $this->currentUser;
+  }
+
 }
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php
index 1b948f1..b2ffe00 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php
@@ -28,6 +28,13 @@
 abstract class CachePluginBase extends PluginBase {
 
   /**
+   * Current user object.
+   *
+   * @var \Drupal\Core\Session\AccountInterface
+   */
+  protected $currentUser;
+
+  /**
    * Contains all data that should be written/read from cache.
    */
   var $storage = array();
@@ -269,7 +276,7 @@ public function restoreHeaders() {
    *   The generated cache ID.
    */
   public function generateResultsKey() {
-    global $user;
+    $user = $this->currentUser();
 
     if (!isset($this->resultsKey)) {
       $build_info = $this->view->build_info;
@@ -310,7 +317,7 @@ public function generateResultsKey() {
    *   The generated cache ID.
    */
   public function generateOutputKey() {
-    global $user;
+    $user = $this->currentUser();
     if (!isset($this->outputKey)) {
       $key_data = array(
         'result' => $this->view->result,
@@ -327,6 +334,18 @@ public function generateOutputKey() {
     return $this->outputKey;
   }
 
+  /**
+   * Gets the current active user.
+   *
+   * @return \Drupal\Core\Session\AccountInterface
+   */
+  protected function currentUser() {
+    if (!$this->currentUser) {
+      $this->currentUser = \Drupal::currentUser();
+    }
+    return $this->currentUser;
+  }
+
 }
 
 /**
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
index 1a96c60..9462273 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
@@ -30,6 +30,13 @@
 abstract class DisplayPluginBase extends PluginBase {
 
   /**
+   * Current user object.
+   *
+   * @var \Drupal\Core\Session\AccountInterface
+   */
+  protected $currentUser;
+
+  /**
    * The top object of a view.
    *
    * @var \Drupal\views\ViewExecutable
@@ -2541,8 +2548,7 @@ public function renderArea($area, $empty = FALSE) {
    */
   public function access($account = NULL) {
     if (!isset($account)) {
-      global $user;
-      $account = $user;
+      $account = $this->currentUser();
     }
 
     // Full override.
@@ -2876,6 +2882,18 @@ protected function mergeHandler($type) {
     $this->setOption($types[$type]['plural'], $options);
   }
 
+  /**
+   * Gets the current active user.
+   *
+   * @return \Drupal\Core\Session\AccountInterface
+   */
+  protected function currentUser() {
+    if (!$this->currentUser) {
+      $this->currentUser = \Drupal::currentUser();
+    }
+    return $this->currentUser;
+  }
+
 }
 
 /**
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
index 8c69290..ca8e6e5 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
@@ -42,6 +42,13 @@
 abstract class FilterPluginBase extends HandlerBase {
 
   /**
+   * Current user object.
+   *
+   * @var \Drupal\Core\Session\AccountInterface
+   */
+  protected $currentUser;
+
+  /**
    * Contains the actual value of the field,either configured in the views ui
    * or entered in the exposed filters.
    */
@@ -1359,9 +1366,8 @@ public function storeExposedInput($input, $status) {
     }
 
     // Check if we store exposed value for current user.
-    global $user;
     $allowed_rids = empty($this->options['expose']['remember_roles']) ? array() : array_filter($this->options['expose']['remember_roles']);
-    $intersect_rids = array_intersect(array_keys($allowed_rids), $user->getRoles());
+    $intersect_rids = array_intersect(array_keys($allowed_rids), $this->currentUser()->getRoles());
     if (empty($intersect_rids)) {
       return;
     }
@@ -1440,6 +1446,18 @@ protected static function arrayFilterZero($var) {
     return trim($var) != '';
   }
 
+  /**
+   * Gets the current active user.
+   *
+   * @return \Drupal\Core\Session\AccountInterface
+   */
+  protected function currentUser() {
+    if (!$this->currentUser) {
+      $this->currentUser = \Drupal::currentUser();
+    }
+    return $this->currentUser;
+  }
+
 }
 
 /**
