]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1417229 - Enable Triage Lead on a component to see security bugs in that component
authordklawren <dklawren@users.noreply.github.com>
Wed, 28 Aug 2019 22:20:19 +0000 (18:20 -0400)
committerKohei Yoshino <kohei.yoshino@gmail.com>
Wed, 28 Aug 2019 22:20:19 +0000 (18:20 -0400)
Bugzilla/Search.pm
Bugzilla/User.pm
extensions/BugModal/template/en/default/bug_modal/groups.html.tmpl

index a022826153622874553079fd2fda48b092d7ee81..25da159e8a0eeecd6f53d4f1ba24edaa5c942b61 100644 (file)
@@ -1381,7 +1381,15 @@ sub _standard_joins {
       as    => 'security_cc',
       extra => ['security_cc.who = ' . $user->id],
     };
-    push(@joins, $security_cc_join);
+    my $security_triage_join = {
+      table => 'components',
+      as    => 'security_triage',
+      from  => 'bugs.component_id',
+      to    => 'id',
+      join  => 'LEFT',
+      extra => ['security_triage.triage_owner_id = ' . $user->id],
+    };
+    push(@joins, $security_cc_join, $security_triage_join);
   }
 
   return @joins;
@@ -1462,6 +1470,7 @@ sub _standard_where {
         OR (bugs.reporter_accessible = 1 AND bugs.reporter = $userid)
         OR (bugs.cclist_accessible = 1 AND security_cc.who IS NOT NULL)
         OR bugs.assigned_to = $userid
+        OR security_triage.triage_owner_id IS NOT NULL
 END
     if (Bugzilla->params->{'useqacontact'}) {
       $security_term .= "        OR bugs.qa_contact = $userid";
index 051d5900f1c5185b4f586436322354d6050d3d9b..c2accd711ad5dd44198e92b6fbf43f77f856682e 100644 (file)
@@ -1529,12 +1529,14 @@ sub visible_bugs {
       # same result for bug_group_map.bug_id (so DISTINCT filters
       # out duplicate rows).
       "SELECT DISTINCT bugs.bug_id, reporter, assigned_to, qa_contact,
-                    reporter_accessible, cclist_accessible, cc.who,
-                    bug_group_map.bug_id
+                    components.triage_owner_id, reporter_accessible,
+                    cclist_accessible, cc.who, bug_group_map.bug_id
                FROM bugs
                     LEFT JOIN cc
                               ON cc.bug_id = bugs.bug_id
                                  AND cc.who = $user_id
+                    LEFT JOIN components
+                              ON bugs.component_id = components.id
                     LEFT JOIN bug_group_map
                               ON bugs.bug_id = bug_group_map.bug_id
                                  AND bug_group_map.group_id NOT IN ("
@@ -1549,12 +1551,13 @@ sub visible_bugs {
     $sth->execute(@check_ids);
     my $use_qa_contact = Bugzilla->params->{'useqacontact'};
     while (my $row = $sth->fetchrow_arrayref) {
-      my ($bug_id, $reporter, $owner, $qacontact, $reporter_access, $cclist_access,
-        $isoncclist, $missinggroup)
+      my ($bug_id, $reporter, $owner, $qacontact, $triage_owner, $reporter_access,
+          $cclist_access, $isoncclist, $missinggroup)
         = @$row;
       $visible_cache->{$bug_id}
         ||= ((($reporter == $user_id) && $reporter_access)
           || ($use_qa_contact && $qacontact && ($qacontact == $user_id))
+          || ($triage_owner && $triage_owner == $user_id)
           || ($owner == $user_id)
           || ($isoncclist && $cclist_access)
           || !$missinggroup) ? 1 : 0;
index 966cefdcf0e6d4f187e92a452b57fcab097c65b2..16ba919d694c1b720e59114cb6f81ea720c225fa 100644 (file)
              [% " disabled=\"disabled\"" UNLESS user_can_edit_accessible %]>
       <label for="cclist_accessible">CC List</label>
     </div>
-    The assignee [% IF (Param('useqacontact')) %]and QA contact[% END %]
-    can always see [% terms.abug %], and this section does not take effect
-    unless the [% terms.bug %] is restricted to at least one group.
+    The assignee[% IF (Param('useqacontact')) %], QA contact, [% END %]
+    and triage owner can always see [% terms.abug %], and this section does not
+    take effect unless the [% terms.bug %] is restricted to at least one group.
   [% END %]
 </div>