summaryrefslogtreecommitdiff
path: root/app/policies
diff options
context:
space:
mode:
authorLuke Bennett <lukeeeebennettplus@gmail.com>2018-07-23 14:30:11 +0100
committerBob Van Landuyt <bob@vanlanduyt.co>2018-07-26 19:00:56 +0200
commit01fd71adbd2736dcf28e56eb54301b4a01c0f81b (patch)
tree70cf1bf8d4c78d4c080bfd7e8fa405df4968e376 /app/policies
parent626d5caf0fb4fe242c24dda294457479eebe6c16 (diff)
downloadgitlab-ce-01fd71adbd2736dcf28e56eb54301b4a01c0f81b.tar.gz
Add read_instance_statistics global policy
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/global_policy.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/policies/global_policy.rb b/app/policies/global_policy.rb
index 6e3827736b2..bf146dc375b 100644
--- a/app/policies/global_policy.rb
+++ b/app/policies/global_policy.rb
@@ -19,6 +19,9 @@ class GlobalPolicy < BasePolicy
@user&.required_terms_not_accepted?
end
+ condition(:private_instance_statistics, score: 0) { Gitlab::CurrentSettings.instance_statistics_visibility_private? }
+ rule { admin | ~private_instance_statistics }.enable :read_instance_statistics
+
rule { anonymous }.policy do
prevent :log_in
prevent :receive_notifications