fix: require INVITE_EXTERNAL_USERS for externalInvitations query#1384
Open
damsleth wants to merge 1 commit into
Open
fix: require INVITE_EXTERNAL_USERS for externalInvitations query#1384damsleth wants to merge 1 commit into
damsleth wants to merge 1 commit into
Conversation
Read access to the pending external-user invitations list (names, emails, inviter) now matches the write access required by inviteExternalUser and cancelExternalInvitation. Previously any authenticated tenant user could fetch it. The invitations field is bundled into the UsersAdmin query, so the Admin Users tab would otherwise 403 for admins lacking INVITE_EXTERNAL_USERS. Guard the field with @include(if: $includeInvitations) and derive the variable client-side via usePermissions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@Authorized<IAuthOptions>({ scope: PermissionScope.INVITE_EXTERNAL_USERS })to theexternalInvitationsquery so read access matches the gating already in place oninviteExternalUserandcancelExternalInvitation. Before this change, any authenticated tenant user could fetch the list of pending invitations (names, emails, inviter).UsersAdminquery, which ACCESS_ADMIN users open without necessarily holding INVITE_EXTERNAL_USERS. To avoid a FORBIDDEN on that shared query, guard the field with@include(if: \$includeInvitations)and derive the variable client-side viausePermissions.Test plan
npm run lintpassesnpm testpasses for the new SubscriptionResolver tests (3 added); pre-existing unrelated TS2694/TS2339 failures in ReportService / extensions / passport index remain unchanged on this branch and on baseexternalInvitationsdirectly (receives FORBIDDEN)