diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-24 01:34:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-24 01:34:10 +0300 |
commit | 96855c4214715fe718c02a308ddd0e4a3265b5d1 (patch) | |
tree | 1dd318ede0a420effd7d0eb41a980c4adc24fae5 /app/policies/namespace_policy.rb | |
parent | 5248069bd6ee923a76047fa74dee46155c40fa2b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/policies/namespace_policy.rb')
-rw-r--r-- | app/policies/namespace_policy.rb | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/app/policies/namespace_policy.rb b/app/policies/namespace_policy.rb index dcbeda9f5d3..0cf1bcb9737 100644 --- a/app/policies/namespace_policy.rb +++ b/app/policies/namespace_policy.rb @@ -1,26 +1,9 @@ # frozen_string_literal: true -class NamespacePolicy < BasePolicy - rule { anonymous }.prevent_all - - condition(:personal_project, scope: :subject) { @subject.kind == 'user' } - condition(:can_create_personal_project, scope: :user) { @user.can_create_project? } - condition(:owner) { @subject.owner == @user } - - rule { owner | admin }.policy do - enable :owner_access - enable :create_projects - enable :admin_namespace - enable :read_namespace - enable :read_statistics - enable :create_jira_connect_subscription - enable :create_package_settings - enable :read_package_settings - end - - rule { personal_project & ~can_create_personal_project }.prevent :create_projects - - rule { (owner | admin) & can?(:create_projects) }.enable :transfer_projects +class NamespacePolicy < ::Namespaces::UserNamespacePolicy + # NamespacePolicy has been traditionally for user namespaces. + # So these policies have been moved into Namespaces::UserNamespacePolicy. + # Once the user namespace conversion is complete, we can look at + # either removing this file or locating common namespace policy items + # here. end - -NamespacePolicy.prepend_mod_with('NamespacePolicy') |