mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Remove enable_whispers site setting (#19196)
* DEV: Remove enable_whispers site setting Whispers are enabled as long as there is at least one group allowed to whisper, see whispers_allowed_groups site setting. * DEV: Always enable whispers for admins if at least one group is allowed.
This commit is contained in:
@@ -20,10 +20,9 @@ module Roleable
|
||||
|
||||
def whisperer?
|
||||
@whisperer ||= begin
|
||||
return false if !SiteSetting.enable_whispers?
|
||||
return true if staff?
|
||||
whispers_allowed_group_ids = SiteSetting.whispers_allowed_group_ids
|
||||
return false if whispers_allowed_group_ids.blank?
|
||||
return true if admin
|
||||
return true if whispers_allowed_group_ids.include?(primary_group_id)
|
||||
group_users&.exists?(group_id: whispers_allowed_group_ids)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user