Skip to content
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

Merged
merged 5 commits into from
Apr 1, 2025

Conversation

mifu67
Copy link
Contributor

@mifu67 mifu67 commented Mar 28, 2025

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.

@mifu67 mifu67 requested review from leedongwei and cathteng March 28, 2025 23:24
@mifu67 mifu67 requested a review from a team as a code owner March 28, 2025 23:25
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 28, 2025
@@ -74,22 +73,6 @@
"""


class RelaxedMemberPermission(OrganizationPermission):
Copy link
Contributor Author

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
Copy link
Member

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"],
Copy link
Member

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

Copy link

codecov bot commented Mar 28, 2025

Codecov Report

Attention: Patch coverage is 98.41270% with 1 line in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...pi/endpoints/organization_member_invite/details.py 96.87% 1 Missing ⚠️
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               

Base automatically changed from mifu67/member-invite/org-member-invite-index to master March 31, 2025 21:19
@mifu67 mifu67 requested review from a team as code owners March 31, 2025 21:19
@mifu67 mifu67 merged commit 41a90b6 into master Apr 1, 2025
48 checks passed
@mifu67 mifu67 deleted the mifu67/member-invite/omi-details-get branch April 1, 2025 16:04
andrewshie-sentry pushed a commit that referenced this pull request Apr 8, 2025
…#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants