Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1912884 - Users who cannot comment on a bug should not be able to change a bug's resolution #2295

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions extensions/MozChangeField/lib/Pre/CommentClosedBugs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ sub evaluate_change {


# If this bug is closed and the current user has no role on the bug, then do
# not allow commenting on a bug that is not open.
if ($field =~ /^longdesc/ && $bug->id && !$bug->isopened && $new_value ne $old_value) {
# not allow commenting on or changing a resolution on a bug that is not open.
if ( ($field =~ /^longdesc/ || $field eq 'resolution')
&& $bug->id
&& !$bug->isopened
&& $new_value ne $old_value)
{
my $has_role
= ( $editbugs
|| $bug->reporter->id eq $user->id
Expand All @@ -48,7 +52,7 @@ sub evaluate_change {

return {
result => PRIVILEGES_REQUIRED_EMPOWERED,
reason => 'You need permission to comment on this closed bug.',
reason => 'You need permission to modify this closed bug.',
};
}

Expand Down
Loading