# Why can't users invite others to messages when account approval is enabled?

**URL:** https://meta.discourse.org/t/why-cant-users-invite-others-to-messages-when-account-approval-is-enabled/56743
**Category:** Bug
**Created:** [01.Февраль.2017 20:54:10 UTC](https://meta.discourse.org/t/why-cant-users-invite-others-to-messages-when-account-approval-is-enabled/56743 "2017-02-01T20:54:10Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![XieLong](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xielong/32/67063_2.png) [@XieLong](https://meta.discourse.org/u/XieLong)
#### Post date: [01.Февраль.2017 20:54:10 UTC](https://meta.discourse.org/t/why-cant-users-invite-others-to-messages-when-account-approval-is-enabled/56743/1 "2017-02-01T20:54:10Z")

</div>

Hi!

In my Discourse instance I have the problem that users would like to invite (and remove) other users to (group) messages - but they can’t although all of them have trust level 2 (it’s just a small user base).

What trust level or permissions or settings are required for a user to invite someone to an existing message thread?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [01.Февраль.2017 21:46:40 UTC](https://meta.discourse.org/t/why-cant-users-invite-others-to-messages-when-account-approval-is-enabled/56743/2 "2017-02-01T21:46:40Z")

</div>

If you have SSO enabled, invites are no longer possible as they would bypass SSO authentication.

Also if you have disabled local auth (username/password accounts) invites are also no longer possible.

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [01.Февраль.2017 22:43:47 UTC](https://meta.discourse.org/t/why-cant-users-invite-others-to-messages-when-account-approval-is-enabled/56743/3 "2017-02-01T22:43:47Z")

</div>

Invite to a topic is different than invite to a forum. You should still be able to invite existing users to participate in a topic with SSO. I believe that is the request here.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [01.Февраль.2017 22:51:19 UTC](https://meta.discourse.org/t/why-cant-users-invite-others-to-messages-when-account-approval-is-enabled/56743/4 "2017-02-01T22:51:19Z")

</div>

I see, thanks for the clarification @elijah, if we are talking about adding _existing accounts_ to a group message, I can’t think of any reason TL2 users wouldn’t be able to do that.

---

<div class="post-metadata">

### Author: ![XieLong](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xielong/32/67063_2.png) [@XieLong](https://meta.discourse.org/u/XieLong)
#### Post date: [01.Февраль.2017 23:18:38 UTC](https://meta.discourse.org/t/why-cant-users-invite-others-to-messages-when-account-approval-is-enabled/56743/5 "2017-02-01T23:18:38Z")

</div>

> [@codinghorror](#):
>
> if we are talking about adding existing accounts to a group message

That’s exactly what my question is about.

All accounts were created by importing them via an Import-Script (based on the [punBB Importer](https://github.com/discourse/discourse/blob/master/script/import_scripts/punbb.rb)) and than assigned trust level 2 (as they were already established members of the old forum).

All admin accounts are able to invite users to group messages. T2 and T3 users not.

More infos: Discourse is v1.7.2 (stable)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [01.Февраль.2017 23:37:39 UTC](https://meta.discourse.org/t/why-cant-users-invite-others-to-messages-when-account-approval-is-enabled/56743/6 "2017-02-01T23:37:39Z")

</div>

Sounds like something possibly went awry in the import, is my only guess.

---

<div class="post-metadata">

### Author: ![XieLong](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xielong/32/67063_2.png) [@XieLong](https://meta.discourse.org/u/XieLong)
#### Post date: [02.Февраль.2017 02:57:52 UTC](https://meta.discourse.org/t/why-cant-users-invite-others-to-messages-when-account-approval-is-enabled/56743/7 "2017-02-02T02:57:52Z")

</div>

I found the problem(?) with my setup.

In `lib/guardian.rb` method `can_invite_to?` there is the following check:

```plaintext
return false unless (!SiteSetting.must_approve_users? || is_staff?)
```

and my forum is set up to require staff approval of new members, so that’s why there’s no invitation to group messages. It’s kinda unexpected to have that check for users to invite others to group messages.

* * *

PS: A hard coded trust level requirement (last line of the mentioned method) also seems kind of odd. But I’m not sure as I’m really new to discourse (and Ruby in general)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [02.Февраль.2017 03:07:29 UTC](https://meta.discourse.org/t/why-cant-users-invite-others-to-messages-when-account-approval-is-enabled/56743/8 "2017-02-02T03:07:29Z")

</div>

Hmm technically this is a bit of a bug @techapj as inviting **existing users** to a PM should not be disallowed in this condition.. thanks for tracking that down @XieLong.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [03.Февраль.2017 07:53:03 UTC](https://meta.discourse.org/t/why-cant-users-invite-others-to-messages-when-account-approval-is-enabled/56743/9 "2017-02-03T07:53:03Z")

</div>

Fixed via

[https://github.com/discourse/discourse/commit/dc2171960bef96eab1269405233dd41603d28417](https://github.com/discourse/discourse/commit/dc2171960bef96eab1269405233dd41603d28417)

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [03.Февраль.2017 07:53:07 UTC](https://meta.discourse.org/t/why-cant-users-invite-others-to-messages-when-account-approval-is-enabled/56743/10 "2017-02-03T07:53:07Z")

</div>


