diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index b767b9b..711fc35 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -22,6 +22,7 @@
 use Drupal\entity\Entity\EntityFormDisplay;
 use Drupal\file\Entity\File;
 use Drupal\user\UserInterface;
+use Drupal\Core\Session\AccountInterface;
 
 /**
  * Denotes that the node is not published.
@@ -1634,24 +1635,19 @@ function node_permissions_get_configured_types() {
  *
  * @param $op
  *   The operation that the user is trying to perform.
- * @param $account
- *   (optional) The user object for the user performing the operation. If
- *   omitted, the current user is used.  Defaults to NULL.
+ * @param \Drupal\Core\Session\AccountInterface $account
+ *  The user object for the user performing the operation.
  *
  * @return
  *   An associative array in which the keys are realms, and the values are
  *   arrays of grants for those realms.
  */
-function node_access_grants($op, $account = NULL) {
-
-  if (!isset($account)) {
-    $account = $GLOBALS['user'];
-  }
+function node_access_grants($op, AccountInterface $account) {
 
   // Fetch node access grants from other modules.
   $grants = \Drupal::moduleHandler()->invokeAll('node_grants', array($account, $op));
   // Allow modules to alter the assigned grants.
-  drupal_alter('node_grants', $grants, $account, $op);
+  \Drupal::moduleHandler()->alter('node_grants', $grants, $account, $op);
 
   return array_merge(array('all' => array(0)), $grants);
 }
