summaryrefslogtreecommitdiff
path: root/app/policies
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-07-25 17:36:08 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-07-27 15:54:28 +0200
commit00b5f5475f7f35620d01033711cdb8e2f5fff5c8 (patch)
tree128cc055ea7a8233ca23b0b78fd2a7dc646d063b /app/policies
parent702a09c18365cbaa88edb8396339a61a73f29d23 (diff)
downloadgitlab-ce-00b5f5475f7f35620d01033711cdb8e2f5fff5c8.tar.gz
Spec instance statistics
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/global_policy.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/policies/global_policy.rb b/app/policies/global_policy.rb
index bf146dc375b..16c58730878 100644
--- a/app/policies/global_policy.rb
+++ b/app/policies/global_policy.rb
@@ -20,7 +20,9 @@ class GlobalPolicy < BasePolicy
end
condition(:private_instance_statistics, score: 0) { Gitlab::CurrentSettings.instance_statistics_visibility_private? }
- rule { admin | ~private_instance_statistics }.enable :read_instance_statistics
+
+ rule { admin | (~private_instance_statistics & ~anonymous) }
+ .enable :read_instance_statistics
rule { anonymous }.policy do
prevent :log_in