Skip to content

Commit 5929fb9

Browse files
committed
Bug 504461: Allow everyone to make bugs security-sensitive retroactively
1 parent 9365f5f commit 5929fb9

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

Bugzilla/Bug.pm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2915,11 +2915,11 @@ sub add_group {
29152915
# If the bug is already in this group, then there is nothing to do.
29162916
return if $self->in_group($group);
29172917

2918-
29192918
# BMO : allow bugs to be always placed into some groups by the bug's
2920-
# reporter
2921-
if ($self->{reporter_id} != Bugzilla->user->id
2922-
|| !$self->product_obj->group_always_settable($group))
2919+
# reporter, or by users with editbugs
2920+
my $user = Bugzilla->user;
2921+
if (!$self->product_obj->group_always_settable($group)
2922+
|| ($self->{reporter_id} != $user->id && !$user->in_group('editbugs')))
29232923
{
29242924
# Make sure that bugs in this product can actually be restricted
29252925
# to this group by the current user.
@@ -2928,7 +2928,7 @@ sub add_group {
29282928

29292929
# OtherControl people can add groups only during a product change,
29302930
# and only when the group is not NA for them.
2931-
if (!Bugzilla->user->in_group($group->name)) {
2931+
if (!$user->in_group($group->name)) {
29322932
my $controls = $self->product_obj->group_controls->{$group->id};
29332933
if (!$self->{_old_product_name}
29342934
|| $controls->{othercontrol} == CONTROLMAPNA)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[%# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
#
5+
# This Source Code Form is "Incompatible With Secondary Licenses", as
6+
# defined by the Mozilla Public License, v. 2.0.
7+
#%]
8+
9+
[% RETURN IF
10+
bug.in_group(bug.product_obj.default_security_group_obj)
11+
|| user.in_group(bug.product_obj.default_security_group)
12+
|| (user.id != bug.reporter.id && !user.in_group('editbugs'))
13+
%]
14+
15+
<div class="bz_group_visibility_section">
16+
<input type="checkbox" name="groups"
17+
value="[% bug.product_obj.default_security_group FILTER none %]"
18+
id="group_[% bug.product_obj.default_security_group_obj.id FILTER html %]"
19+
onchange="if (this.checked) document.getElementById('addselfcc').checked = true"
20+
>
21+
<label for="group_[% bug.product_obj.default_security_group_obj.id FILTER html %]"
22+
title="This [% terms.bug %] is security sensitive and should be hidden from the public until it is resolved">
23+
Restrict access to this [% terms.bug %]
24+
</label>
25+
</div><br>

template/en/default/bug/edit.html.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@
200200
[% END %]
201201
</td>
202202
<td>
203+
[%# BMO hook for adding custom group visibility %]
204+
[% Hook.process('before_restrict_visibility', 'bug/edit.html.tmpl') %]
203205
[% PROCESS section_restrict_visibility %]
204206
</td>
205207
</tr></table>

0 commit comments

Comments
 (0)