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/namespaces/user_namespace_policy.rb')
-rw-r--r--app/policies/namespaces/user_namespace_policy.rb3
1 files changed, 3 insertions, 0 deletions
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