? 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-new-column.patch
? 920614-node-access.patch
? file_download_access6.patch
? test.patch
? sites/default/files
? sites/default/private
Index: modules/node/node.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.api.php,v
retrieving revision 1.73
diff -u -p -r1.73 node.api.php
--- modules/node/node.api.php	3 Sep 2010 19:56:51 -0000	1.73
+++ modules/node/node.api.php	24 Sep 2010 18:46:25 -0000
@@ -177,11 +177,13 @@ function hook_node_grants($account, $op)
  *   hook_node_grants().
  * - 'gid': A 'grant ID' from hook_node_grants().
  * - 'grant_view': If set to 1 a user that has been identified as a member
- *   of this gid within this realm can view this node.
+ *   of this gid within this realm can view this node if it is published.
  * - 'grant_update': If set to 1 a user that has been identified as a member
  *   of this gid within this realm can edit this node.
  * - 'grant_delete': If set to 1 a user that has been identified as a member
  *   of this gid within this realm can delete this node.
+ * - 'grant_view_unpublished': If set to 1 a user that has been identified as a *   member of this gid within this realm can view this node if it is
+ *   unpublished.
  * - 'priority': If multiple modules seek to set permissions on a node, the
  *   realms that have the highest priority will win out, and realms with a lower
  *   priority will not be written. If there is any doubt, it is best to
@@ -204,6 +206,7 @@ function hook_node_access_records($node)
       'grant_view' => 1,
       'grant_update' => 0,
       'grant_delete' => 0,
+      'grant_view_unpublished' => 0,
       'priority' => 0,
     );
 
@@ -215,6 +218,7 @@ function hook_node_access_records($node)
       'grant_view' => 1,
       'grant_update' => 1,
       'grant_delete' => 1,
+      'grant_view_unpublished' => 1,
       'priority' => 0,
     );
     return $grants;
Index: modules/node/node.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.install,v
retrieving revision 1.55
diff -u -p -r1.55 node.install
--- modules/node/node.install	13 Sep 2010 05:50:09 -0000	1.55
+++ modules/node/node.install	24 Sep 2010 18:46:26 -0000
@@ -178,6 +178,14 @@ function node_schema() {
         'default' => 0,
         'size' => 'tiny',
       ),
+      'grant_view_unpublished' => array(
+        'description' => 'Boolean indicating whether a user with the realm/grant pair can view this node if it is not published.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+        'size' => 'tiny',
+      ),
     ),
     'primary key' => array('nid', 'gid', 'realm'),
     'foreign keys' => array(
@@ -734,6 +742,21 @@ function node_update_7010() {
 }
 
 /**
+ * Add the grant_view_unpublished column to {node_access}.
+ */
+function node_update_7011() {
+  $spec = array(
+    'description' => 'Boolean indicating whether a user with the realm/grant pair can view this node if it is not published.',
+    'type' => 'int',
+    'unsigned' => TRUE,
+    'not null' => TRUE,
+    'default' => 0,
+    'size' => 'tiny',
+  );
+  db_add_field('node_access', 'grant_view_unpublished', $spec);
+}
+
+/**
  * @} End of "defgroup updates-6.x-to-7.x"
  * The next series of updates should start at 8000.
  */
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:46:30 -0000
@@ -2793,6 +2793,9 @@ function node_access($op, $node, $accoun
     if (module_implements('node_grants')) {
       $query = db_select('node_access');
       $query->addExpression('1');
+      if ($op == 'view' && !$node->status) {
+        $op = 'view_unpublished';
+      }
       $query->condition('grant_' . $op, 1, '>=');
       $nids = db_or()->condition('nid', $node->nid);
       if ($node->status) {
