Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cd7bc802
Commit
cd7bc802
authored
Dec 14, 2020
by
Małgorzata Ksionek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix get endpoint not returning members with minimal access
parent
c0f74cfd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
ee/spec/requests/api/members_spec.rb
ee/spec/requests/api/members_spec.rb
+21
-0
lib/api/members.rb
lib/api/members.rb
+1
-1
No files found.
ee/spec/requests/api/members_spec.rb
View file @
cd7bc802
...
...
@@ -114,6 +114,27 @@ RSpec.describe API::Members do
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
)
puts
json_response
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
context
'group members endpoint for group managed accounts'
do
...
...
lib/api/members.rb
View file @
cd7bc802
...
...
@@ -62,7 +62,7 @@ module API
get
":id/members/:user_id"
do
source
=
find_source
(
source_type
,
params
[
:id
])
members
=
source
.
members
members
=
source
_members
(
source
)
member
=
members
.
find_by!
(
user_id:
params
[
:user_id
])
present_members
member
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment