FIX: ignore min_trust_to_send_messages when messaging groups (#8104)

This means that TL0 users can message groups with "Who can message this
group?" set to "Everyone".

It also means that members of a group with "Who can message this
group?" set to "members, moderators and admins" can also message the
group, even when their trust level is below min_trust_to_send_messages.
This commit is contained in:
Penar Musaraj
2019-09-18 15:23:13 -04:00
committed by GitHub
parent cad83bf071
commit c6cfbebf1f
2 changed files with 14 additions and 1 deletions

View File

@ -407,7 +407,7 @@ class Guardian
# User is authenticated
authenticated? &&
# Have to be a basic level at least
(@user.has_trust_level?(SiteSetting.min_trust_to_send_messages) || notify_moderators) &&
(is_group || @user.has_trust_level?(SiteSetting.min_trust_to_send_messages) || notify_moderators) &&
# User disabled private message
(is_staff? || is_group || target.user_option.allow_private_messages) &&
# PMs are enabled