diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-01 15:10:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-01 15:10:48 +0300 |
commit | a21091270d45530468f8ac2f4f926fe1b9840b67 (patch) | |
tree | a641a030521f16e320f1d3559a49956f485c217f /app/policies | |
parent | 8700fc108e2c269a4d73530d60662a6aaff14381 (diff) |
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 1c23b367489..7b01dccff87 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(:creator) do + @user == @subject.creator + end + with_options scope: :subject, score: 0 condition(:is_instance_runner) do @subject.instance_type? @@ -72,6 +76,8 @@ module Ci rule { ~admin & belongs_to_multiple_projects }.prevent :delete_runner rule { ~admin & locked }.prevent :assign_runner + + rule { creator }.enable :read_ephemeral_token end end |