diff options
author | Simon Green <sgreen@redhat.com> | 2013-12-18 11:47:13 +0100 |
---|---|---|
committer | Simon Green <sgreen@redhat.com> | 2013-12-18 11:47:13 +0100 |
commit | 9e7ad08c56aacbe889b614ee2394b58b108c9ca2 (patch) | |
tree | ab3fd04b3e7330ca8996a29e3d28c1374370b46b /request.cgi | |
parent | 8465c056a7c2cac1d6905e8b476f200b934f11b0 (diff) | |
download | bugzilla-9e7ad08c56aacbe889b614ee2394b58b108c9ca2.tar.gz bugzilla-9e7ad08c56aacbe889b614ee2394b58b108c9ca2.tar.xz |
Bug 452525 - Allow the option of "OR" groups ("any of the groups" instead of "all of the groups")
r=gerv, a=sgreen
Diffstat (limited to 'request.cgi')
-rwxr-xr-x | request.cgi | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/request.cgi b/request.cgi index 118935092..b771cee37 100755 --- a/request.cgi +++ b/request.cgi @@ -118,20 +118,27 @@ sub queue { ON bugs.product_id = products.id INNER JOIN components ON bugs.component_id = components.id - LEFT JOIN bug_group_map AS bgmap - ON bgmap.bug_id = bugs.bug_id - AND bgmap.group_id NOT IN (" . - $user->groups_as_string . ") LEFT JOIN bug_group_map AS privs ON privs.bug_id = bugs.bug_id LEFT JOIN cc AS ccmap ON ccmap.who = $userid AND ccmap.bug_id = bugs.bug_id - " . + LEFT JOIN bug_group_map AS bgmap + ON bgmap.bug_id = bugs.bug_id + "; + + if (Bugzilla->params->{or_groups}) { + $query .= " AND bgmap.group_id IN (" . $user->groups_as_string . ")"; + $query .= " WHERE (privs.group_id IS NULL OR bgmap.group_id IS NOT NULL OR"; + } + else { + $query .= " AND bgmap.group_id NOT IN (" . $user->groups_as_string . ")"; + $query .= " WHERE (bgmap.group_id IS NULL OR"; + } # Weed out bug the user does not have access to - " WHERE ((bgmap.group_id IS NULL) OR - (ccmap.who IS NOT NULL AND cclist_accessible = 1) OR + $query .= + " (ccmap.who IS NOT NULL AND cclist_accessible = 1) OR (bugs.reporter = $userid AND bugs.reporter_accessible = 1) OR (bugs.assigned_to = $userid) " . (Bugzilla->params->{'useqacontact'} ? "OR |