summaryrefslogtreecommitdiff
path: root/app/policies
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-10 00:06:44 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-10 00:06:44 +0000
commit308146dc398fd4c13453048105498018459e0985 (patch)
treed843eb63c1672e4b18c483907e2cd4aa7fca708e /app/policies
parent4b28d5ae770c6bd332283a3f13ceae06329c409b (diff)
downloadgitlab-ce-308146dc398fd4c13453048105498018459e0985.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/base_policy.rb4
-rw-r--r--app/policies/global_policy.rb6
2 files changed, 10 insertions, 0 deletions
diff --git a/app/policies/base_policy.rb b/app/policies/base_policy.rb
index 2305c55033f..18c23cbd13a 100644
--- a/app/policies/base_policy.rb
+++ b/app/policies/base_policy.rb
@@ -17,6 +17,10 @@ class BasePolicy < DeclarativePolicy::Base
with_options scope: :user, score: 0
condition(:blocked) { @user&.blocked? }
+ desc "User is deactivated"
+ with_options scope: :user, score: 0
+ condition(:deactivated) { @user&.deactivated? }
+
desc "User has access to all private groups & projects"
with_options scope: :user, score: 0
condition(:full_private_access) { @user&.full_private_access? }
diff --git a/app/policies/global_policy.rb b/app/policies/global_policy.rb
index 659fde574fc..4d66a9e7d67 100644
--- a/app/policies/global_policy.rb
+++ b/app/policies/global_policy.rb
@@ -44,6 +44,12 @@ class GlobalPolicy < BasePolicy
prevent :use_slash_commands
end
+ rule { deactivated }.policy do
+ prevent :access_git
+ prevent :access_api
+ prevent :receive_notifications
+ end
+
rule { required_terms_not_accepted }.policy do
prevent :access_api
prevent :access_git