disallow group runners to become project runners
This commit is contained in:
parent
4b1b2f3b10
commit
d0842d2075
2 changed files with 7 additions and 0 deletions
|
@ -206,6 +206,7 @@ module API
|
|||
def authenticate_enable_runner!(runner)
|
||||
forbidden!("Runner is shared") if runner.is_shared?
|
||||
forbidden!("Runner is locked") if runner.locked?
|
||||
forbidden!("Runner is a group runner") if runner.group?
|
||||
return if current_user.admin?
|
||||
|
||||
forbidden!("No access granted") unless user_can_access_runner?(runner)
|
||||
|
|
|
@ -658,6 +658,12 @@ describe API::Runners do
|
|||
expect(response).to have_gitlab_http_status(403)
|
||||
end
|
||||
|
||||
it 'does not enable group runner' do
|
||||
post api("/projects/#{project.id}/runners", user), runner_id: group_runner.id
|
||||
|
||||
expect(response).to have_http_status(403)
|
||||
end
|
||||
|
||||
context 'user is admin' do
|
||||
it 'enables any specific runner' do
|
||||
expect do
|
||||
|
|
Loading…
Reference in a new issue