Index: actions/actions.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/actions/actions.inc,v
retrieving revision 1.4
diff -u -F^f -r1.4 actions.inc
--- actions/actions.inc 29 Jan 2005 18:57:55 -0000      1.4
+++ actions/actions.inc 7 Jun 2005 02:54:18 -0000
@@ -280,6 +280,68 @@ function action_node_unpromote($op, $edi

 /**
  * Implementation of a Drupal action.
+ * Remokes author editing privs via node_access
+ *
+ */
+function action_node_revoke_edit($op, $edit = array(), &$node) {
+  switch($op) {
+    case 'metadata':
+      return array(
+        'description' => t('Revokes node author editing priviliges'),
+        'type' => t('Node'),
+        'batchable' => true,
+        'configurable' => false,
+      );
+      break;
+
+    case 'do':
+      if (!$edit['defer']) {
+        $sql = "DELETE FROM {node_access} WHERE nid=%d AND gid=%d AND realm='workflow_uid'";
+        db_query($sql, $node->nid, $node->uid);
+      }
+      watchdog('action', t('Revoked edit privs to node ') . ' ' . intval($node->nid) . ' ' . t('author'));
+      break;
+
+    // process the HTML form to store configuration
+    case 'submit':
+      return '';
+      break;
+  }
+}
+
+/**
+ * Implementation of a Drupal action.
+ * Allows the author editing privs via node_access
+ *
+ */
+function action_node_grant_edit($op, $edit = array(), &$node) {
+  switch($op) {
+    case 'metadata':
+      return array(
+        'description' => t('Allow node author editing priviliges'),
+        'type' => t('Node'),
+        'batchable' => true,
+        'configurable' => false,
+      );
+      break;
+
+    case 'do':
+      if (!$edit['defer']) {
+        $sql = "REPLACE INTO {node_access} (nid, gid, realm, grant_update) VALUES (%d, %d, 'workflow_uid', 1)";
+        db_query($sql, $node->nid, $node->uid);
+      }
+      watchdog('action', t('Granted edit privs to node ') . ' ' . intval($node->nid) . ' ' . t('author'));
+      break;
+
+    // process the HTML form to store configuration
+    case 'submit':
+      return '';
+      break;
+  }
+}
+


Index: workflow/workflow.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/workflow/workflow.module,v
retrieving revision 1.18
diff -u -F^f -r1.18 workflow.module
--- workflow/workflow.module    26 Apr 2005 03:19:53 -0000      1.18
+++ workflow/workflow.module    7 Jun 2005 02:55:50 -0000
@@ -200,6 +225,14 @@ function workflow_nodeapi($node, $op) {
 }

 /**
+ * Implementation of hook_node_grants()
+ */
+function workflow_node_grants($user, $op) {
+  return array('workflow_uid' => array($user->uid) );
+}
+
+
+/**
  * Implementation of hook_workflow()
  */
 function workflow_workflow($op, $old_state, $new_state, $node) {
