summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Attachment.pm
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-03-03 16:35:59 +0100
committerByron Jones <glob@mozilla.com>2015-03-03 16:35:59 +0100
commit8d20ba6e2308484b6685c35a832033fcfff89f17 (patch)
tree42978b922b82b4174418c7d852b73c32120b17f0 /Bugzilla/Attachment.pm
parentf569d5ef56d4975fe8ffee7182125cac776c327d (diff)
downloadbugzilla-8d20ba6e2308484b6685c35a832033fcfff89f17.tar.gz
bugzilla-8d20ba6e2308484b6685c35a832033fcfff89f17.tar.xz
Bug 1137368: Allow the bug's assignee to edit attachment fields, even if they do not have editbugs
Diffstat (limited to 'Bugzilla/Attachment.pm')
-rw-r--r--Bugzilla/Attachment.pm15
1 files changed, 12 insertions, 3 deletions
diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm
index 8361c1cce..f5929c4a7 100644
--- a/Bugzilla/Attachment.pm
+++ b/Bugzilla/Attachment.pm
@@ -732,9 +732,18 @@ sub validate_can_edit {
my $user = Bugzilla->user;
# The submitter can edit their attachments.
- return ($self->attacher->id == $user->id
- || ((!$self->isprivate || $user->is_insider)
- && $user->in_group('editbugs', $self->bug->product_id))) ? 1 : 0;
+ return 1 if $self->attacher->id == $user->id;
+
+ # Private attachments
+ return 0 if $self->isprivate && !$user->is_insider;
+
+ # BMO: if you can edit the bug, then you can also edit any of its attachments
+ return 1 if $self->bug->user->{canedit};
+
+ # If you are in editbugs for this product
+ return 1 if $user->in_group('editbugs', $self->bug->product_id);
+
+ return 0;
}
=item C<validate_obsolete($bug, $attach_ids)>