未验证 提交 d0842d20 编写于 作者: A Alexis Reigel 提交者: Alexis Reigel

disallow group runners to become project runners

上级 4b1b2f3b
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册