diff options
author | Byron Jones <glob@mozilla.com> | 2015-08-10 15:21:05 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2015-08-10 15:21:05 +0200 |
commit | 7e41532fd90edd907bffc283b39f1c1d3397ab4a (patch) | |
tree | d55ffdf88eccbd4a20fb17b0567f8c3553d8ef6a /extensions/BMO/Extension.pm | |
parent | 2c5c3580b800128be213964311b4f6c3becb7523 (diff) | |
download | bugzilla-7e41532fd90edd907bffc283b39f1c1d3397ab4a.tar.gz bugzilla-7e41532fd90edd907bffc283b39f1c1d3397ab4a.tar.xz |
Bug 1153108 - add page allowing users to grant canconfirm rights onto themselves
Diffstat (limited to 'extensions/BMO/Extension.pm')
-rw-r--r-- | extensions/BMO/Extension.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index 34e346a24..a72cc3cab 100644 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -227,6 +227,9 @@ sub page_before_template { elsif ($page eq 'attachment_bounty_form.html') { bounty_attachment($vars); } + elsif ($page eq 'triage_request.html') { + triage_request($vars); + } } sub bounty_attachment { @@ -355,6 +358,18 @@ sub parse_bounty_attachment_description { }; } +sub triage_request { + my ($vars) = @_; + my $user = Bugzilla->login(LOGIN_REQUIRED); + if (Bugzilla->input_params->{update}) { + Bugzilla->set_user(Bugzilla::User->super_user); + $user->set_groups({ add => [ 'canconfirm' ] }); + Bugzilla->set_user($user); + $user->update(); + $vars->{updated} = 1; + } +} + sub _get_field_values_sort_key { my ($field) = @_; my $dbh = Bugzilla->dbh; |