Group member update access level #2745
-
Hello, I can't update group member access level. Here is what I already did : I tried with that code : member = group.members_all.get(group_member.id)
member.access_level=40
member.save() But I get : 'GroupMemberAll' object has no attribute 'save' Then I saw this pull request My question is, how can I update a group member access level, from this list : Thank's for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you do:
That might work, if the member is in 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 |
Beta Was this translation helpful? Give feedback.
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:
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