Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/policies/base_policy.rb')
-rw-r--r--app/policies/base_policy.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/policies/base_policy.rb b/app/policies/base_policy.rb
index f8e7a912896..1ce866bd910 100644
--- a/app/policies/base_policy.rb
+++ b/app/policies/base_policy.rb
@@ -19,6 +19,14 @@ class BasePolicy < DeclarativePolicy::Base
with_options scope: :user, score: 0
condition(:deactivated) { @user&.deactivated? }
+ desc "User is bot"
+ with_options scope: :user, score: 0
+ condition(:bot) { @user&.bot? }
+
+ desc "User is alert bot"
+ with_options scope: :user, score: 0
+ condition(:alert_bot) { @user&.alert_bot? }
+
desc "User is support bot"
with_options scope: :user, score: 0
condition(:support_bot) { @user&.support_bot? }
@@ -50,9 +58,6 @@ class BasePolicy < DeclarativePolicy::Base
::Gitlab::ExternalAuthorization.perform_check?
end
- with_options scope: :user, score: 0
- condition(:alert_bot) { @user&.alert_bot? }
-
rule { external_authorization_enabled & ~can?(:read_all_resources) }.policy do
prevent :read_cross_project
end