diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-11 21:14:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-11 21:14:04 +0300 |
commit | 11c2b8eff6ca5360fb0f732b23b764d2a0b81be5 (patch) | |
tree | 7f92622462127ff24023283133f81d9c4b2f6842 /app/policies/project_policy.rb | |
parent | e40f19ef830c5863089bc6a7a73e6695efa60a13 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/policies/project_policy.rb')
-rw-r--r-- | app/policies/project_policy.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index c2d1447bf8b..d81db357162 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -47,6 +47,9 @@ class ProjectPolicy < BasePolicy desc "Project is archived" condition(:archived, scope: :subject, score: 0) { project.archived? } + desc "Project is in the process of being deleted" + condition(:pending_delete) { project.pending_delete? } + condition(:default_issues_tracker, scope: :subject) { project.default_issues_tracker? } desc "Container registry is disabled" @@ -457,7 +460,13 @@ class ProjectPolicy < BasePolicy prevent(*readonly_abilities) readonly_features.each do |feature| - prevent(*create_update_admin_destroy(feature)) + prevent(*create_update_admin(feature)) + end + end + + rule { archived & ~pending_delete }.policy do + readonly_features.each do |feature| + prevent(:"destroy_#{feature}") end end |