Invite settings (PR #10274)

Added a PR for this


Thank you for the PR. It looks like some core specs are still failing.

Do we need this alias here? I don’t see it being used in the PR.

      it 'returns true if user has sufficient trust level' do
      it 'returns false if user trust level does not have sufficient trust level' do

The test here doesn’t look right. topic is a regular topic and not a PM which we should be testing for.

Same as

This doesn’t look right to me since an object can either be an instance of Topic or something else. Also, topic can either be a public topic or a PM.

    it 'returns true when sso is disabled, local logins are enabled, user approval is not required and trust level is sufficient' do

I don’t think this is correct because Guardian#can_invite_to_forum? uses the SiteSetting.min_trust_to_allow_invite. I’m also not sure if we need to set the site setting when the default value is already 2.

Same concerns as

Same concerns as

TrustLevel[2] => 2

looks right to me @tgxworld

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

:white_check_mark: jahan-ggn
:x: SamSaffron
You have signed the CLA already but the status is still pending? Let us recheck it.

Sorry I mucked up this PR a bit and @tgxworld’s comment is still not addressed, the check applied to non personal messages but the site setting says it is for pms.

Closing this for now, we can revisit.