Commit 631f7026 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Don't check for admin permission if we're not

going to change shared_runners_minutes_limit

Feedback:
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1942/diffs#note_30680494
parent 93083a43
......@@ -128,7 +128,10 @@ module API
authorize! :admin_group, group
# EE
authenticated_as_admin! if params[:shared_runners_minutes_limit]
if params[:shared_runners_minutes_limit].to_i !=
group.shared_runners_minutes_limit.to_i
authenticated_as_admin!
end
if ::Groups::UpdateService.new(group, current_user, declared_params(include_missing: false)).execute
present group, with: Entities::GroupDetail, current_user: current_user
......
......@@ -279,6 +279,14 @@ describe API::Groups do
expect(response).to have_http_status(403)
end
it 'returns 200 if shared_runners_minutes_limit is not changing' do
group1.update(shared_runners_minutes_limit: 133)
put api("/groups/#{group1.id}", user1), shared_runners_minutes_limit: 133
expect(response).to have_http_status(200)
end
end
context 'when authenticated as the admin' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment