mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FEATURE: Allow specific groups to view raw email (#26003)
When a post is created by an incoming email, we show an envelope icon on it which then opens a modal with the raw email contents. Previously this was staff (admin+mod) only, but now this commit adds the `view_raw_email_allowed_groups` site setting, so any group can be added to give users permission to see this.
This commit is contained in:
@ -75,7 +75,8 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
:use_experimental_topic_bulk_actions?,
|
||||
:use_experimental_topic_bulk_actions?,
|
||||
:use_admin_sidebar,
|
||||
:glimmer_header_enabled?
|
||||
:glimmer_header_enabled?,
|
||||
:can_view_raw_email
|
||||
|
||||
delegate :user_stat, to: :object, private: true
|
||||
delegate :any_posts, :draft_count, :pending_posts_count, :read_faq?, to: :user_stat
|
||||
@ -316,4 +317,8 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
def use_experimental_topic_bulk_actions?
|
||||
scope.user.in_any_groups?(SiteSetting.experimental_topic_bulk_actions_enabled_groups_map)
|
||||
end
|
||||
|
||||
def can_view_raw_email
|
||||
scope.user.in_any_groups?(SiteSetting.view_raw_email_allowed_groups_map)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user