FIX: Trust level when inviting users to group (PR #12993)

Bug reproduction steps:

  1. In admin trust level settings, set min trust level to allow invite to 2
  2. Login with a user belonging to a group and having trust level 1
  3. Select Add Members and invite new users

The invite is successfully sent despite the logged-in user not having sufficient privilege.

Fix is to check the current user’s trust level when adding new members of a group.

Fixes 189357


Thanks, this looks good!

This pull request has been mentioned on Discourse Meta. There might be relevant details there: