Index: workflow.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/workflow/workflow.admin.inc,v
retrieving revision 1.7
diff -u -p -r1.7 workflow.admin.inc
--- workflow.admin.inc	1 Jan 2009 20:33:20 -0000	1.7
+++ workflow.admin.inc	29 Jan 2009 17:35:02 -0000
@@ -304,7 +304,15 @@ function workflow_edit_form_validate($fo
     form_set_error('wf_name', t('Please provide a nonblank name for this workflow.'));
   }
 
-  // Make sure 'author' is checked for (creation) -> [something].
+  $assigned_types = db_query("SELECT type FROM {workflow_type_map} WHERE wid = %d", $wid);
+  $create_roles = user_roles(FALSE, 'administer nodes');
+  while ($assigned_type = db_fetch_object($assigned_types)) {
+    // Track all roles that can create content types associated with this workflow.
+    $create_roles += user_roles(FALSE, 'create '. $assigned_type->type .' content');
+  }
+  $count_roles = count($create_roles);
+  // Make sure 'author' is checked for (creation) -> [something] or else all roles with create permission for related content types are checked.
+
   $creation_id = _workflow_creation_state($wid);
   if (isset($form_state['values']['transitions'][$creation_id]) && is_array($form_state['values']['transitions'][$creation_id])) {
     foreach ($form_state['values']['transitions'][$creation_id] as $to => $roles) {
@@ -312,11 +320,17 @@ function workflow_edit_form_validate($fo
         $author_has_permission = TRUE;
         break;
       }
+      foreach(array_filter($roles) as $role_key => $value) {
+        if(isset($create_roles[$role_key])) {
+          unset($create_roles[$role_key]);
+        }
+      }
     }
   }
   $state_count = db_result(db_query("SELECT COUNT(sid) FROM {workflow_states} WHERE wid = %d", $wid));
-  if (empty($author_has_permission) && $state_count > 1) {
-    form_set_error('transitions', t('Please give the author permission to go from %creation to at least one state!',
+  // Allow 'author' checkbox to be empty as long as all roles which can create nodes in this workflow have creation transitions.
+  if (empty($author_has_permission) && $state_count > 1 && (!$count_roles || count($create_roles))) {
+    form_set_error('transitions', t('Please give either the author or all roles that can create nodes associated with this workflow permission to go from %creation to at least one state!',
       array('%creation' => '(creation)')));
   }
 }
@@ -687,6 +701,6 @@ function theme_workflow_types_form($form
 function workflow_types_form_submit($form, &$form_state) {
   workflow_types_save($form_state['values']);
   drupal_set_message(t('The workflow mapping was saved.'));
-  menu_rebuild(); 
+  menu_rebuild();
   $form_state['redirect'] = 'admin/build/workflow';
-}
\ No newline at end of file
+}
