summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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();