summaryrefslogtreecommitdiffstats
path: root/post_bug.cgi
diff options
context:
space:
mode:
authorbugreport%peshkin.net <>2006-01-03 07:57:06 +0100
committerbugreport%peshkin.net <>2006-01-03 07:57:06 +0100
commit972eed87eba7dafcf50b5cd9c8993735690807d9 (patch)
tree423d5918ca77ef6378b784dc7cf987cdd8aef346 /post_bug.cgi
parent1874993b3189dc1a1057c11433dfe16470cf8fae (diff)
downloadbugzilla-972eed87eba7dafcf50b5cd9c8993735690807d9.tar.gz
bugzilla-972eed87eba7dafcf50b5cd9c8993735690807d9.tar.xz
Bug 313547: When strict_isolation is set, don't allow inappropriate users on new bugs
Patch by Joel Peshkin <bugreport@peshkin.net> r=lpsolit, a=justdave
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-xpost_bug.cgi22
1 files changed, 22 insertions, 0 deletions
diff --git a/post_bug.cgi b/post_bug.cgi
index 964515926..3d2d6ab48 100755
--- a/post_bug.cgi
+++ b/post_bug.cgi
@@ -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)) {