FEATURE: whispers available for groups (#17170)

Before, whispers were only available for staff members.

Config has been changed to allow to configure privileged groups with access to whispers. Post migration was added to move from the old setting into the new one.

I considered having a boolean column `whisperer` on user model similar to `admin/moderator` for performance reason. Finally, I decided to keep looking for groups as queries are only done for current user and didn't notice any N+1 queries.
This commit is contained in:
Krzysztof Kotlarek
2022-06-30 10:18:12 +10:00
committed by GitHub
parent f44eb13236
commit 09932738e5
40 changed files with 275 additions and 56 deletions

View File

@ -14,7 +14,7 @@ class Unread
return 0 if @topic_user.last_read_post_number.blank?
return 0 if do_not_notify?(@topic_user.notification_level)
highest_post_number = @guardian.is_staff? ? @topic.highest_staff_post_number : @topic.highest_post_number
highest_post_number = @guardian.is_whisperer? ? @topic.highest_staff_post_number : @topic.highest_post_number
return 0 if @topic_user.last_read_post_number > highest_post_number