# Hack to enable invitations for Trust level 1 users

**URL:** <https://meta.discourse.org/t/hack-to-enable-invitations-for-trust-level-1-users/44103>\
**Category:** Support\
**Created:** [12 Maggio 2016, 6:26am UTC](https://meta.discourse.org/t/hack-to-enable-invitations-for-trust-level-1-users/44103 "2016-05-12T06:26:44Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)\
**Post date:** [13 Giugno 2017, 11:47am UTC](https://meta.discourse.org/t/hack-to-enable-invitations-for-trust-level-1-users/44103/11 "2017-06-13T11:47:15Z")

</div>

```plaintext
after_initialize do
  Guardian.class_eval do
    def can_invite_to_forum?(groups=nil)
      authenticated? &&
      (SiteSetting.max_invites_per_day.to_i > 0 || is_staff?) &&
      !SiteSetting.enable_sso &&
      SiteSetting.enable_local_logins &&
      (
        (!SiteSetting.must_approve_users? && @user.has_trust_level?(TrustLevel[1])) ||
       is_staff?
      ) &&
      (groups.blank? || is_admin?)
    end
  end
end

```

I guess this is the code you need. Put it in `plugin.rb` file. Since I am not in PC I didn’t tested it.

---

_[View the full topic](https://meta.discourse.org/t/hack-to-enable-invitations-for-trust-level-1-users/44103)._
