Skip to content

Commit 1c734cc

Browse files
authored
Bug 1989605 - Don't allow brand-new accounts to use the Triage Request Form to self-grant
1 parent f90ba69 commit 1c734cc

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

extensions/BMO/Extension.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ sub parse_bounty_attachment_description {
417417
sub triage_request {
418418
my ($vars) = @_;
419419
my $user = Bugzilla->login(LOGIN_REQUIRED);
420-
if (Bugzilla->input_params->{update}) {
420+
if (!$user->is_new && Bugzilla->input_params->{update}) {
421421
Bugzilla->set_user(Bugzilla::User->super_user);
422422
$user->set_groups({add => ['canconfirm']});
423423
Bugzilla->set_user($user);

extensions/BMO/template/en/default/pages/get_permissions.html.tmpl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212

1313
<h3>How to apply for upgraded permissions</h3>
1414

15-
<p>
16-
If you want <kbd>canconfirm</kbd>, you can add it yourself using
17-
the <a href="[% basepath FILTER none %]page.cgi?id=triage_request.html">triage request form</a>.
18-
</p>
15+
[% IF !user.is_new %]
16+
<p>
17+
If you want <kbd>canconfirm</kbd>, you can add it yourself using
18+
the <a href="[% basepath FILTER none %]page.cgi?id=triage_request.html">triage request form</a>.
19+
</p>
20+
[% END %]
1921

2022
[% editbugs = basepath _ "enter_bug.cgi?assigned_to=nobody%40mozilla.org&bug_file_loc=http%3A%2F%2F&bug_ignored=0&bug_type=task&bug_severity=--&bug_status=NEW&cf_fx_iteration=---&cf_fx_points=---&component=Editbugs%20Requests&contenttypemethod=autodetect&contenttypeselection=text%2Fplain&defined_groups=1&flag_type-4=X&flag_type-607=X&flag_type-791=X&flag_type-800=X&flag_type-803=X&flag_type-916=X&form_name=enter_bug&maketemplate=Remember%20values%20as%20bookmarkable%20template&op_sys=Unspecified&priority=--&product=bugzilla.mozilla.org&rep_platform=Unspecified&target_milestone=---&version=Production" %]
2123

extensions/BMO/template/en/default/pages/triage_request.html.tmpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@
4747
faster.
4848
</p>
4949

50+
[% ELSIF user.is_new %]
51+
52+
<p>
53+
Your account is still too new to request the ability to triage [% terms.bugs %].
54+
Please check back at a later time to see when you will become eligible.
55+
</p>
56+
5057
[% ELSE %]
5158

5259
<p>

0 commit comments

Comments
 (0)