Commit ac9d28d5 authored by Dylan Griffith's avatar Dylan Griffith

Merge branch...

Merge branch '292987-group-member-with-minimal-access-missing-from-api-groups-id-members-user_id' into 'master'

Fix get endpoint not returning members with minimal access

See merge request gitlab-org/gitlab!49996
parents b72ae798 fae27261
---
title: Fix get endpoint not returning members with minimal access
merge_request: 49996
author:
type: fixed
...@@ -114,6 +114,26 @@ RSpec.describe API::Members do ...@@ -114,6 +114,26 @@ RSpec.describe API::Members do
end end
end end
end end
describe 'GET /groups/:id/members/:user_id' do
context 'when minimal access role is available' do
it 'shows the member' do
stub_licensed_features(minimal_access_role: true)
get api("/groups/#{group.id}/members/#{minimal_access_member.user_id}", owner)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['id']).to eq(minimal_access_member.user_id)
end
end
context 'when minimal access role is not available' do
it 'does not show the member' do
get api("/groups/#{group.id}/members/#{minimal_access_member.id}", owner)
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
end end
context 'group members endpoint for group managed accounts' do context 'group members endpoint for group managed accounts' do
......
...@@ -62,7 +62,7 @@ module API ...@@ -62,7 +62,7 @@ module API
get ":id/members/:user_id" do get ":id/members/:user_id" do
source = find_source(source_type, params[:id]) source = find_source(source_type, params[:id])
members = source.members members = source_members(source)
member = members.find_by!(user_id: params[:user_id]) member = members.find_by!(user_id: params[:user_id])
present_members member present_members member
......
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