- Notifications
You must be signed in to change notification settings - Fork673
feat: add feature to get inherited member for project/group#1187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
1b62c2e
50f4b9c
565151a
55cdad8
323c279
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1163,37 +1163,18 @@ class GroupMember(SaveMixin, ObjectDeleteMixin, RESTObject): | ||
_short_print_attr = "username" | ||
class GroupMemberManager(MemberAllMixin,CRUDMixin, RESTManager): | ||
_path = "/groups/%(group_id)s/members" | ||
_obj_cls = GroupMember | ||
_from_parent_attrs = {"group_id": "id"} | ||
_create_attrs = (("access_level", "user_id"), ("expires_at",)) | ||
_update_attrs = (("access_level",), ("expires_at",)) | ||
class GroupMemberAllManager(RetrieveMixin, RESTManager): | ||
_path = "/groups/%(group_id)s/members/all" | ||
_obj_cls = GroupMember | ||
_from_parent_attrs = {"group_id": "id"} | ||
class GroupMergeRequest(RESTObject): | ||
@@ -1394,6 +1375,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject): | ||
("issues", "GroupIssueManager"), | ||
("labels", "GroupLabelManager"), | ||
("members", "GroupMemberManager"), | ||
("members_all", "GroupMemberAllManager"), | ||
("mergerequests", "GroupMergeRequestManager"), | ||
("milestones", "GroupMilestoneManager"), | ||
("notificationsettings", "GroupNotificationSettingsManager"), | ||
@@ -2831,37 +2813,18 @@ class ProjectMember(SaveMixin, ObjectDeleteMixin, RESTObject): | ||
_short_print_attr = "username" | ||
class ProjectMemberManager(MemberAllMixin,CRUDMixin, RESTManager): | ||
_path = "/projects/%(project_id)s/members" | ||
_obj_cls = ProjectMember | ||
_from_parent_attrs = {"project_id": "id"} | ||
_create_attrs = (("access_level", "user_id"), ("expires_at",)) | ||
_update_attrs = (("access_level",), ("expires_at",)) | ||
class ProjectMemberAllManager(RetrieveMixin, RESTManager): | ||
_path = "/projects/%(project_id)s/members/all" | ||
_obj_cls = ProjectMember | ||
nejch marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
_from_parent_attrs = {"project_id": "id"} | ||
class ProjectNote(RESTObject): | ||
@@ -4595,6 +4558,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject): | ||
("issues", "ProjectIssueManager"), | ||
("labels", "ProjectLabelManager"), | ||
("members", "ProjectMemberManager"), | ||
("members_all", "ProjectMemberAllManager"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. For me the dilemma here is: Just asking because this pattern can be a precedent for improving other There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I spent a few minutes scanning the GitLab API and looks GitLab doesn't tend to make its addresses natural. Anyway, I am not a python Pro, final conclusion is up to you. | ||
("mergerequests", "ProjectMergeRequestManager"), | ||
("milestones", "ProjectMilestoneManager"), | ||
("notes", "ProjectNoteManager"), | ||
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -312,7 +312,8 @@ | ||||||||
group1.members.delete(user1.id) | ||||||||
assert len(group1.members.list()) == 2 | ||||||||
assert len(group1.members.all()) # Deprecated | ||||||||
assert len(group1.members_all.list()) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Suggested change
As you can see in the test you've had to change in50f4b9c, this would break the existing behavior for anyone who has relied on Maybe that can be done (temporarily) with a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I rolled back the test casegroup1.members.all() and addedMemberAllMixin with | ||||||||
member = group1.members.get(user2.id) | ||||||||
member.access_level = gitlab.const.OWNER_ACCESS | ||||||||
member.save() | ||||||||