diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-16 18:08:16 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-16 18:08:16 +0000 |
commit | 204df35415f2b0ed86c83b31b1d276f52e07e577 (patch) | |
tree | 1db4c0f302c145a5b6cd02afe7d49ea72267f612 /app/policies | |
parent | db19df23733c768c564534a09de2e6718097ec95 (diff) | |
download | gitlab-ce-204df35415f2b0ed86c83b31b1d276f52e07e577.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/ci/runner_policy.rb | 6 |
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 |