# Missing "invite others..." button for staff moderators when PM is disabled

**URL:** <https://meta.discourse.org/t/missing-invite-others-button-for-staff-moderators-when-pm-is-disabled/65930>\
**Category:** Bug\
**Created:** [Julho 10, 2017, 12:16pm UTC](https://meta.discourse.org/t/missing-invite-others-button-for-staff-moderators-when-pm-is-disabled/65930 "2017-07-10T12:16:54Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![BaldvinTh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/baldvinth/32/50395_2.png) [@BaldvinTh](https://meta.discourse.org/u/BaldvinTh)\
**Post date:** [Julho 10, 2017, 12:16pm UTC](https://meta.discourse.org/t/missing-invite-others-button-for-staff-moderators-when-pm-is-disabled/65930/1 "2017-07-10T12:16:54Z")

</div>

Greetings!

I’ve encountered a slight issue, not sure if this is by design for some reason, but it seems that staff moderators are not included in `can_invite_to(o,g)` when `SiteSetting.enable_private_messages` is disabled. This makes mods unable to invite other moderators or groups to private messages / warnings.

Lines [248-260 in guardian.rb](https://github.com/discourse/discourse/blob/master/lib/guardian.rb#L248-L260) seem to describe that administrators can ignore the enable\_private\_messages just fine, but staff moderators appear to be left out.

Would it be viable to replace `is_admin` with `is_staff` here?

```plaintext
  def can_invite_to?(object, group_ids=nil)
    return false unless authenticated?
- return true if is_admin?
+ return true if is_staff?
    return false unless SiteSetting.enable_private_messages?
    return false if (SiteSetting.max_invites_per_day.to_i == 0 && !is_staff?)
    return false unless can_see?(object)
    return false if group_ids.present?

    if object.is_a?(Topic) && object.category
      if object.category.groups.any?
        return true if object.category.groups.all? { |g| can_edit_group?(g) }
      end
    end

```

Reproduction steps:

As **admin**

- Have private messages disabled
- Send a message / warning to any user
- Invite moderators group to convo with “invite others…” button

As **staff moderator**

- Have private messages disabled
- Send a message / warning to any user
- Notice missing “invite other…” button, cannot involve other moderators / staff members

---

_[View the full topic](https://meta.discourse.org/t/missing-invite-others-button-for-staff-moderators-when-pm-is-disabled/65930)._
