diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 155736359..88fc0ff26 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -796,9 +796,11 @@ sub _check_bug_status @valid_statuses = grep { $_->is_confirmed } @valid_statuses; } - if ($self->assigned_to_id && $user->id != $self->assigned_to_id) + my $allow_assigned = 1; + if (!Bugzilla->params->{assign_to_others} && $self->assigned_to_id && $user->id != $self->assigned_to_id) { # You can not assign bugs to other people + $allow_assigned = 0; @valid_statuses = grep { !$_->is_assigned } @valid_statuses; } @@ -817,14 +819,15 @@ sub _check_bug_status } # We skip this check if we are changing from a status to itself. - if ((!$old_status || $old_status->id != $new_status->id) && + if ((!$old_status || $old_status->id != $new_status->id || + !$new_status->is_confirmed && !$product->allows_unconfirmed) && !grep { $_->id == $new_status->id } @valid_statuses) { ThrowUserError('illegal_bug_status_transition', { old => $old_status, new => $new_status, allow_unconfirmed => $product->allows_unconfirmed, - allow_assigned => !$self->assigned_to_id || $user->id == $self->assigned_to_id, + allow_assigned => $allow_assigned, }); } diff --git a/Bugzilla/Config/BugChange.pm b/Bugzilla/Config/BugChange.pm index 42a539e32..7057de8d5 100644 --- a/Bugzilla/Config/BugChange.pm +++ b/Bugzilla/Config/BugChange.pm @@ -124,7 +124,13 @@ sub get_param_list name => 'noresolveonopenblockers', type => 'b', default => 0, - } + }, + + { + name => 'assign_to_others', + type => 'b', + default => 1, + }, ); return @param_list; } diff --git a/template/en/default/admin/params/bugchange.html.tmpl b/template/en/default/admin/params/bugchange.html.tmpl index 3c7213a17..cb9e2c166 100644 --- a/template/en/default/admin/params/bugchange.html.tmpl +++ b/template/en/default/admin/params/bugchange.html.tmpl @@ -60,4 +60,8 @@ "Don\'t allow $terms.bugs to be resolved as fixed " _ "if they have unresolved dependencies." + assign_to_others => + "Allow to assign bugs to other people, i.e. allow to set bug status " _ + "that has 'is assigned' flag turned on if 'assigned to' is not equal to you." + } %]