diff options
author | mkanat%bugzilla.org <> | 2006-08-23 05:42:25 +0000 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2006-08-23 05:42:25 +0000 |
commit | 363f5a4e621378b1343c4621a765cb9aa9025cb9 (patch) | |
tree | d225177ce1bcc75ef4af6b46b887b55ca60911da /Bugzilla | |
parent | 2de6abfda1e684d218b8d9b251a1153ce30f89e2 (diff) | |
download | bugs-363f5a4e621378b1343c4621a765cb9aa9025cb9.tar bugs-363f5a4e621378b1343c4621a765cb9aa9025cb9.tar.gz bugs-363f5a4e621378b1343c4621a765cb9aa9025cb9.tar.bz2 bugs-363f5a4e621378b1343c4621a765cb9aa9025cb9.tar.xz bugs-363f5a4e621378b1343c4621a765cb9aa9025cb9.zip |
Bug 349561: Move the strict_isolation check from post_bug into Bugzilla::Bug
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=bkor, a=justdave
Diffstat (limited to 'Bugzilla')
-rwxr-xr-x | Bugzilla/Bug.pm | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 406e70aca..2f5d08bfe 100755 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -406,6 +406,37 @@ sub _check_short_desc { return $short_desc; } +# Unlike other checkers, this one doesn't return anything. +sub _check_strict_isolation { + my ($product, $cc_ids, $assignee_id, $qa_contact_id) = @_; + + return unless Bugzilla->params->{'strict_isolation'}; + + my @related_users = @$cc_ids; + push(@related_users, $assignee_id); + + if (Bugzilla->params->{'useqacontact'} && $qa_contact_id) { + push(@related_users, $qa_contact_id); + } + + # For each unique user in @related_users...(assignee and qa_contact + # could be duplicates of users in the CC list) + my %unique_users = map {$_ => 1} @related_users; + my @blocked_users; + foreach my $pid (keys %unique_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->name}); + } +} + sub _check_qa_contact { my ($name, $component) = @_; my $user = Bugzilla->user; |