Skip to content

Group member update access level #2745

Closed Answered by JohnVillalovos
icepick4 asked this question in Q&A
Discussion options

You must be logged in to vote

members_all finds all members of all groups under the top-level group. So it doesn't have a way to then modify the member because it can be in possibly any group underneath the top-level group.

If you do:

member = group.members.get(group_member.id)
member.access_level=40
member.save()

That might work, if the member is in group.

If you want to update the membership for every member in every group then you will have to iterate through all the sub-groups. Using something like subgroups = groups.subgroups.list()

https://docs.gitlab.com/ee/api/members.html

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by icepick4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants