2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

FEATURE: blocked users can send and reply to private messages from staff

This commit is contained in:
Neil Lalonde 2016-01-22 12:54:18 -05:00
parent 9569235d76
commit 685ba1eb7f
6 changed files with 47 additions and 13 deletions

View file

@ -256,7 +256,9 @@ class Guardian
@user.username == SiteSetting.site_contact_username ||
@user == Discourse.system_user) &&
# Can't send PMs to suspended users
(is_staff? || target.is_a?(Group) || !target.suspended?)
(is_staff? || target.is_a?(Group) || !target.suspended?) &&
# Blocked users can only send PM to staff
(!@user.blocked? || target.staff?)
end
def can_see_emails?