Index: modules/project/project.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project/project.module,v
retrieving revision 1.181
diff -u -r1.181 project.module
--- modules/project/project.module	6 Feb 2005 19:59:02 -0000	1.181
+++ modules/project/project.module	9 Feb 2005 23:55:41 -0000
@@ -52,13 +52,18 @@
 }
 
 function project_perm() {
-  return array(
+  $perms = array(
     'administer projects',
     'maintain projects',
     'access projects',
     'create project issues',
     'access project issues'
   );
+  $states = project_issue_state();
+  foreach($states as $key => $value) {
+    $perms[] = "set issue status '" . $value . "'";
+  }
+  return $perms;
 }
 
 function project_settings() {
Index: modules/project/issue.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project/issue.inc,v
retrieving revision 1.90
diff -u -r1.90 issue.inc
--- modules/project/issue.inc	6 Feb 2005 12:32:41 -0000	1.90
+++ modules/project/issue.inc	10 Feb 2005 00:00:25 -0000
@@ -5,6 +5,16 @@
   return t('issue');
 }
 
+function project_issue_nodeapi(&$node, $op, $arg) {
+  switch ($op) {
+    case 'validate':
+      if (!user_access("set issue status '" . $node->state . "'")) {
+        form_set_error('state', t('Invalid issue status %status: you do not have permission to set this status', array('%status' => "<em>$node->state</em>")));
+      }
+      break;
+  }
+}
+
 function project_issue_page() {
   switch ($_POST['op'] ? $_POST['op'] : arg(2)) {
     case 'search':
@@ -225,7 +235,7 @@
     }
     $categories = array_merge(t('<none>'), project_issue_category(0, 0));
     $priorities = project_issue_priority();
-    $states = project_issue_state();
+    $states = project_issue_state(0, true);
 
     if ($user->uid == $node->assigned) {
       $assigned = array(0 => t('Unassign'), $user->uid => $user->name);
@@ -410,8 +420,18 @@
 }
 
 // Support stuff
-function project_issue_state($state = 0) {
-  $states = array(1 => t('active'), 2 => t('fixed'), 8=> t('patch'), 3 => t('duplicate'), 4 => t('postponed'), 5 => t("won't fix"), 6 => t('by design'), 7 => t('closed'));
+function project_issue_state($state = 0, $restrict = false) {
+  $options = array(1 => t('active'), 8 => t('patch'), 9 => t('reviewed'), 10 => t('queued for application'), 2 => t('applied'), 3 => t('duplicate'), 4 => t('postponed'), 5 => t("won't fix"), 6 => t('by design'), 7 => t('closed'));
+  if($restrict) {
+    foreach($options as $key => $value) {
+      if (user_access("set project status '" . $value . "'")) {
+        $states[$key] = $value;
+      }
+    }
+  }
+  else {
+    $states = $options;
+  }
   return $state ? $states[$state] : $states;
 }
 
