[MM-60059] Point guest-only inviters to an administrator when the invitee is already a workspace member (#38558)
* [MM-60059] Direct guest-only inviters to an admin when the invitee is already a member When a non-guest is selected in the guest invite flow, the invite modal told every inviter to "invite them as a member instead", even when the inviter has invite_guest but not add_user_to_team and therefore has no member/guest toggle to switch to. Pick the message based on the inviter's add_user_to_team permission on the target team. Co-authored-by: mattermost-code <matty-code@mattermost.com> * Cover the guest-invite permission check with mutation-tested cases Mutation testing showed the permitted-inviter case was only ever proven through a system role, so dropping the team id argument from haveITeamPermission left every test green. Cover an inviter whose add_user_to_team comes from a team role, an inviter with no membership in the invited team, and a batch holding more than one non-guest so the flag cannot be applied to only the first invitee. Co-authored-by: mattermost-code <matty-code@mattermost.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: mattermost-code <matty-code@mattermost.com>
C
cursor[bot] committed
b2c92d7ae3dc9af7e94231bd16c8bbb75101a226
Parent: ee446d5
Committed by GitHub <noreply@github.com>
on 9/16/2026, 4:18:07 PM