summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal/Extension.pm
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-04-07 07:10:42 +0200
committerByron Jones <glob@mozilla.com>2015-04-07 07:10:42 +0200
commit50a1473b3c89bf8fe153cfd9c4c29a0de104d36d (patch)
treeb77aff32d1318ee994a58c9f7d1811d55ddcc187 /extensions/BugModal/Extension.pm
parent3c87e9f850f0b02e768fd1b045299e95bf10959b (diff)
downloadbugzilla-50a1473b3c89bf8fe153cfd9c4c29a0de104d36d.tar.gz
bugzilla-50a1473b3c89bf8fe153cfd9c4c29a0de104d36d.tar.xz
Bug 1149879: bug-modal's editmode is broken for users without editbugs (Form field dup_id was not defined)
Diffstat (limited to 'extensions/BugModal/Extension.pm')
-rw-r--r--extensions/BugModal/Extension.pm18
1 files changed, 17 insertions, 1 deletions
diff --git a/extensions/BugModal/Extension.pm b/extensions/BugModal/Extension.pm
index 3c23d0b90..c07bb4cde 100644
--- a/extensions/BugModal/Extension.pm
+++ b/extensions/BugModal/Extension.pm
@@ -175,8 +175,20 @@ sub template_before_process {
foreach my $r (@{ Bugzilla::Field->new({ name => 'resolution', cache => 1 })->legal_values }) {
my $resolution = $r->name;
next unless $resolution;
- next unless $r->is_active || $resolution eq $bug->resolution;
+ # always allow the current value
+ if ($resolution eq $bug->resolution) {
+ push @resolutions, $r;
+ next;
+ }
+
+ # never allow inactive values
+ next unless $r->is_active;
+
+ # ensure the user has basic rights to change this field
+ next unless $bug->check_can_change_field('resolution', '---', $resolution);
+
+ # canconfirm users can only set the resolution to WFM, INCOMPLETE or DUPE
if ($perms->{canconfirm}
&& !($perms->{canedit} || $perms->{isreporter}))
{
@@ -185,11 +197,15 @@ sub template_before_process {
&& $resolution ne 'INCOMPLETE'
&& $resolution ne 'DUPLICATE';
}
+
+ # reporters can set it to anything, except INCOMPELTE
if ($perms->{isreporter}
&& !($perms->{canconfirm} || $perms->{canedit}))
{
next if $resolution eq 'INCOMPLETE';
}
+
+ # expired has, uh, expired
next if $resolution eq 'EXPIRED';
push @resolutions, $r;