diff --git a/includes/callback_node_access.inc b/includes/callback_node_access.inc
index ce671d7..1a25e91 100644
--- a/includes/callback_node_access.inc
+++ b/includes/callback_node_access.inc
@@ -58,16 +58,9 @@ class SearchApiAlterNodeAccess extends SearchApiAbstractAlterCallback {
    *   An array of items to be altered, keyed by item IDs.
    */
   public function alterItems(array &$items) {
-    static $account;
-
-    if (!isset($account)) {
-      // Load the anonymous user.
-      $account = drupal_anonymous_user();
-    }
-
     foreach ($items as $nid => &$item) {
-      // Check whether all users have access to the node.
-      if (!node_access('view', $item, $account)) {
+      // Check if there are any modules that implements hook_node_grants().
+      if (count(module_implements('node_grants'))) {
         // Get node access grants.
         $result = db_query('SELECT * FROM {node_access} WHERE (nid = 0 OR nid = :nid) AND grant_view = 1', array(':nid' => $item->nid));
 
@@ -80,8 +73,7 @@ class SearchApiAlterNodeAccess extends SearchApiAbstractAlterCallback {
         }
       }
       else {
-        // Add the generic view grant if we are not using node access or the
-        // node is viewable by anonymous users.
+        // Add the generic view grant if we are not using node access.
         $items[$nid]->search_api_access_node = array('node_access__all');
       }
     }
