Invite settings (PR #10274)

Added a PR for this https://meta.discourse.org/t/please-make-tl-for-sending-invites-customisable/139828

GitHub

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 https://github.com/discourse/discourse/pull/10274/files#r459818233

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 https://github.com/discourse/discourse/pull/10274/files#r459820330

Same concerns as https://github.com/discourse/discourse/pull/10274/files#r459820330