summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorSimon Green <sgreen+mozilla@redhat.com>2012-10-09 09:21:12 +0200
committerByron Jones <bjones@mozilla.com>2012-10-09 09:21:12 +0200
commit75c4e8ff9e17ecc195cbd67274bbf8feb05391dc (patch)
tree0b0fef167aacada7ef629b345ca7227c27d48f23 /Bugzilla/Bug.pm
parent50a6d3b41fc549c36c271784ac7a842230cb8408 (diff)
downloadbugzilla-75c4e8ff9e17ecc195cbd67274bbf8feb05391dc.tar.gz
bugzilla-75c4e8ff9e17ecc195cbd67274bbf8feb05391dc.tar.xz
Bug 753635: Allow editing local see also even if you cannot edit the other bug
r=glob, a=LpSolit
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 8c4045c13..7b40fb3b1 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -2854,7 +2854,8 @@ sub add_see_also {
# ref bug id for sending changes email.
my $ref_bug = delete $field_values->{ref_bug};
if ($class->isa('Bugzilla::BugUrl::Bugzilla::Local')
- and !$skip_recursion)
+ and !$skip_recursion
+ and $ref_bug->check_can_change_field('see_also', '', $self->id, \$privs))
{
$ref_bug->add_see_also($self->id, 'skip_recursion');
push @{ $self->{_update_ref_bugs} }, $ref_bug;
@@ -2886,12 +2887,15 @@ sub remove_see_also {
# we need to notify changes for that bug too.
$removed_bug_url = $removed_bug_url->[0];
if (!$skip_recursion and $removed_bug_url
- and $removed_bug_url->isa('Bugzilla::BugUrl::Bugzilla::Local'))
+ and $removed_bug_url->isa('Bugzilla::BugUrl::Bugzilla::Local')
+ and $removed_bug_url->ref_bug_url)
{
my $ref_bug
= Bugzilla::Bug->check($removed_bug_url->ref_bug_url->bug_id);
- if (Bugzilla->user->can_edit_product($ref_bug->product_id)) {
+ if (Bugzilla->user->can_edit_product($ref_bug->product_id)
+ and $ref_bug->check_can_change_field('see_also', $self->id, '', \$privs))
+ {
my $self_url = $removed_bug_url->local_uri($self->id);
$ref_bug->remove_see_also($self_url, 'skip_recursion');
push @{ $self->{_update_ref_bugs} }, $ref_bug;