-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(org member invite): OrganizationMemberInviteDetails GET endpoint #88283
Conversation
@@ -74,22 +73,6 @@ | |||
""" | |||
|
|||
|
|||
class RelaxedMemberPermission(OrganizationPermission): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this to ./organization_member/utils.py
"GET": ApiPublishStatus.EXPERIMENTAL, | ||
"PUT": ApiPublishStatus.EXPERIMENTAL, | ||
} | ||
owner = ApiOwner.ENTERPRISE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think ecosystem / whatever the new name of the team is is owning auth, but can fix later
"PUT": ["member:invite", "member:write", "member:admin"], | ||
# DELETE checks for role comparison as you can either remove a member | ||
# with a lower access role, or yourself, without having the req. scope | ||
"DELETE": ["member:read", "member:write", "member:admin"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for later: we should probably allow deleting an invite/request if the requesting user was the inviter, regardless of scopes
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #88283 +/- ##
===========================================
+ Coverage 42.13% 87.73% +45.60%
===========================================
Files 9969 10002 +33
Lines 564906 566605 +1699
Branches 22255 22255
===========================================
+ Hits 238002 497095 +259093
+ Misses 326486 69092 -257394
Partials 418 418 |
c786c65
to
0627867
Compare
…#88283) The `OrganizationMemberDetails` endpoint also adds lists of serialized team roles and organization roles to the GET response. Talked with @leedongwei: it is not clear why this is necessary, so we decided not to add these fields to the new endpoint. In particular, `allowed_roles = get_allowed_org_roles(request, organization, member)` gets the roles that the _member_ would be allowed to assign when inviting a user to the organization. This only really makes sense when `member` is the requesting user themself, which isn't possible for an invited organization member.
The
OrganizationMemberDetails
endpoint also adds lists of serialized team roles and organization roles to the GET response. Talked with @leedongwei: it is not clear why this is necessary, so we decided not to add these fields to the new endpoint.In particular,
allowed_roles = get_allowed_org_roles(request, organization, member)
gets the roles that the member would be allowed to assign when inviting a user to the organization. This only really makes sense whenmember
is the requesting user themself, which isn't possible for an invited organization member.