summaryrefslogtreecommitdiffstats
path: root/describekeywords.cgi
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2012-04-19 01:11:26 +0200
committerByron Jones <bjones@mozilla.com>2012-04-19 01:11:26 +0200
commit5dd270a16c7a6caea49740b16fc5495dd8d9c036 (patch)
treea8655efe8cff97e84f78323bb71df0fb26ba0b3f /describekeywords.cgi
parentc069c39edb77009ade012f380c7765bfc8d82326 (diff)
downloadbugzilla-5dd270a16c7a6caea49740b16fc5495dd8d9c036.tar.gz
bugzilla-5dd270a16c7a6caea49740b16fc5495dd8d9c036.tar.xz
Bug 744092: filter security bugcounts on describe-keywords
Diffstat (limited to 'describekeywords.cgi')
-rwxr-xr-xdescribekeywords.cgi12
1 files changed, 11 insertions, 1 deletions
diff --git a/describekeywords.cgi b/describekeywords.cgi
index 9796b77d5..b8ed9bb48 100755
--- a/describekeywords.cgi
+++ b/describekeywords.cgi
@@ -38,7 +38,17 @@ my $vars = {};
# Run queries against the shadow DB.
Bugzilla->switch_to_shadow_db;
-$vars->{'keywords'} = Bugzilla::Keyword->get_all_with_bug_count();
+# Hide bug counts for security keywords from users who aren't a member of the
+# security group
+my $can_see_security = Bugzilla->user->in_group('security-group');
+my $keywords = Bugzilla::Keyword->get_all_with_bug_count();
+foreach my $keyword (@$keywords) {
+ $keyword->{'bug_count'} = 0
+ if $keyword->name =~ /^(?:sec|csec|wsec|opsec)-/
+ && !$can_see_security;
+}
+
+$vars->{'keywords'} = $keywords;
$vars->{'caneditkeywords'} = Bugzilla->user->in_group("editkeywords");
print Bugzilla->cgi->header();