? 000-seven-form-css-sanity.patch
? 690828-block-ahah_0.patch
? 732542-system-goto-action-D7.patch
? 735528-states-or.patch
? 823428-entity-uri-34.patch
? 846296-file-download.patch
? 846296-file-download2.patch
? 890716-file-settings.patch
? 920614-node-access.patch
? file_download_access6.patch
? test.patch
? sites/default/files
? sites/default/private
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1302
diff -u -p -r1.1302 node.module
--- modules/node/node.module	24 Sep 2010 00:37:43 -0000	1.1302
+++ modules/node/node.module	24 Sep 2010 18:20:53 -0000
@@ -61,6 +61,18 @@ define('NODE_ACCESS_DENY', 'deny');
 define('NODE_ACCESS_IGNORE', NULL);
 
 /**
+ * Nodes have two states, and node access needs to respond properly. The first
+ * state applies to published content.
+ */
+define('NODE_ACCESS_PUBLISHED', 1);
+
+/**
+ * Nodes have two states, and node access needs to respond properly. The second
+ * state applies to unpublished content.
+ */
+define('NODE_ACCESS_UNPUBLISHED', 2);
+
+/**
  * Implements hook_help().
  */
 function node_help($path, $arg) {
@@ -2793,7 +2805,13 @@ function node_access($op, $node, $accoun
     if (module_implements('node_grants')) {
       $query = db_select('node_access');
       $query->addExpression('1');
-      $query->condition('grant_' . $op, 1, '>=');
+      // The grant state can be 0, not allowed, 1, allowed if published, or
+      // 2, allowed if unpublished.
+      $grant_value = NODE_ACCESS_PUBLISHED;
+      if (!$node->status) {
+        $grant_value = NODE_ACCESS_UNPUBLISHED;
+      }
+      $query->condition('grant_' . $op, $grant_value, '>=');
       $nids = db_or()->condition('nid', $node->nid);
       if ($node->status) {
         $nids->condition('nid', 0);
