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-27 15:54:27 +0200
commit21471777a0f439a9bf46ac2e5e7e7e9906b0ac14 (patch)
treef2d4b1edb8efd5288753fdffd4139d0586bb87e3 /app/policies
parent1a611cf1e5b0a7953fbb2a064aec72ed92b9e735 (diff)
downloadgitlab-ce-21471777a0f439a9bf46ac2e5e7e7e9906b0ac14.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