summaryrefslogtreecommitdiff
path: root/app/policies/ci
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-03-18 20:02:30 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-03-18 20:02:30 +0000
commit41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch)
tree9c8d89a8624828992f06d892cd2f43818ff5dcc8 /app/policies/ci
parent0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff)
downloadgitlab-ce-41fe97390ceddf945f3d967b8fdb3de4c66b7dea.tar.gz
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'app/policies/ci')
-rw-r--r--app/policies/ci/runner_policy.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/policies/ci/runner_policy.rb b/app/policies/ci/runner_policy.rb
index bdbe7021276..6dfe9cc496b 100644
--- a/app/policies/ci/runner_policy.rb
+++ b/app/policies/ci/runner_policy.rb
@@ -9,6 +9,10 @@ module Ci
@user.owns_runner?(@subject)
end
+ condition(:belongs_to_multiple_projects) do
+ @subject.belongs_to_more_than_one_project?
+ end
+
rule { anonymous }.prevent_all
rule { admin }.policy do
@@ -22,6 +26,8 @@ module Ci
enable :delete_runner
end
+ rule { ~admin & belongs_to_multiple_projects }.prevent :delete_runner
+
rule { ~admin & locked }.prevent :assign_runner
end
end