diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-01 00:08:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-01 00:08:01 +0300 |
commit | d88cacce3f205151867ab3f9297f10cdae4a7025 (patch) | |
tree | a511ad558a92a66d0ad8ab635b99d16387be0d2d /app/policies | |
parent | 9e7f94a7408534411dc8da69c9e3ad3a55722b51 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/base_policy.rb | 4 | ||||
-rw-r--r-- | app/policies/concerns/policy_actor.rb | 4 | ||||
-rw-r--r-- | app/policies/namespaces/user_namespace_policy.rb | 3 |
3 files changed, 3 insertions, 8 deletions
diff --git a/app/policies/base_policy.rb b/app/policies/base_policy.rb index 2f0073c00e4..f8e7a912896 100644 --- a/app/policies/base_policy.rb +++ b/app/policies/base_policy.rb @@ -27,10 +27,6 @@ class BasePolicy < DeclarativePolicy::Base with_options scope: :user, score: 0 condition(:security_bot) { @user&.security_bot? } - desc "User is security policy bot" - with_options scope: :user, score: 0 - condition(:security_policy_bot) { @user&.security_policy_bot? } - desc "User is automation bot" with_options scope: :user, score: 0 condition(:automation_bot) { @user&.automation_bot? } diff --git a/app/policies/concerns/policy_actor.rb b/app/policies/concerns/policy_actor.rb index e000f1514e5..8fa09683b06 100644 --- a/app/policies/concerns/policy_actor.rb +++ b/app/policies/concerns/policy_actor.rb @@ -53,10 +53,6 @@ module PolicyActor false end - def security_policy_bot? - false - end - def automation_bot? false end diff --git a/app/policies/namespaces/user_namespace_policy.rb b/app/policies/namespaces/user_namespace_policy.rb index 89158578ac1..1deeae8241f 100644 --- a/app/policies/namespaces/user_namespace_policy.rb +++ b/app/policies/namespaces/user_namespace_policy.rb @@ -5,6 +5,7 @@ module Namespaces rule { anonymous }.prevent_all condition(:can_create_personal_project, scope: :user) { @user.can_create_project? } + condition(:bot_user_namespace) { @subject.bot_user_namespace? } condition(:owner) { @subject.owner == @user } rule { owner | admin }.policy do @@ -21,6 +22,8 @@ module Namespaces rule { ~can_create_personal_project }.prevent :create_projects + rule { bot_user_namespace }.prevent :create_projects + rule { (owner | admin) & can?(:create_projects) }.enable :transfer_projects end end |