]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 753635: Allow editing local see also even if you cannot edit the other bug
authorSimon Green <sgreen+mozilla@redhat.com>
Tue, 9 Oct 2012 07:23:39 +0000 (15:23 +0800)
committerByron Jones <bjones@mozilla.com>
Tue, 9 Oct 2012 07:23:39 +0000 (15:23 +0800)
r=glob, a=LpSolit

Bugzilla/Bug.pm

index 741475a741988b5d436f9abe06bd7afceb68ba95..68682801594e69ca08a493d82cfda5cbe1bfb55a 100644 (file)
@@ -2878,7 +2878,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;
@@ -2910,12 +2911,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;