]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 313547: When strict_isolation is set, don't allow inappropriate users on new...
authorbugreport%peshkin.net <>
Tue, 3 Jan 2006 06:57:06 +0000 (06:57 +0000)
committerbugreport%peshkin.net <>
Tue, 3 Jan 2006 06:57:06 +0000 (06:57 +0000)
Patch by Joel Peshkin <bugreport@peshkin.net>
r=lpsolit, a=justdave

post_bug.cgi
template/en/default/global/user-error.html.tmpl

index 96451592674a1aa5e74a0e30820fa7223b1f810f..3d2d6ab480a0050dc3304274cb4e7403efc760ed 100755 (executable)
@@ -257,6 +257,28 @@ if ($cgi->param('keywords') && UserInGroup("editbugs")) {
     }
 }
 
+if (Param("strict_isolation")) {
+    my @blocked_users = ();
+    my %related_users = %ccids;
+    $related_users{$cgi->param('assigned_to')} = 1;
+    if (Param('useqacontact') && $cgi->param('qa_contact')) {
+        $related_users{$cgi->param('qa_contact')} = 1;
+    }
+    foreach my $pid (keys %related_users) {
+        my $related_user = Bugzilla::User->new($pid);
+        if (!$related_user->can_edit_product($product_id)) {
+            push (@blocked_users, $related_user->login);
+        }
+    }
+    if (scalar(@blocked_users)) {
+        ThrowUserError("invalid_user_group", 
+            {'users' => \@blocked_users,
+             'new' => 1,
+             'product' => $product
+            });
+    }
+}
+
 # Check for valid dependency info. 
 foreach my $field ("dependson", "blocked") {
     if (UserInGroup("editbugs") && $cgi->param($field)) {
index 4ff86c34a97cb5e8a5c28fb146e2495eda718b7f..edacda0e1234d0ff59e876d8110f03c8dab2c000 100644 (file)
     [%+ field_descs.product FILTER html %]
     [% IF bug_id %]
       for [% terms.bug %] '[% bug_id FILTER html %]'.
+    [% ELSIF new %]
+      and may not be included on a new [% terms.bug %].
     [% ELSE %]
       for at least one [% terms.bug %] being changed.
     [% END %]