mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
SECURITY: Moderators cannot see user emails.
Unless `moderators_view_emails` SiteSetting is enabled, moderators should not be able to discover users’ emails.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Admin::ScreenedEmailsController < Admin::StaffController
|
||||
before_action :ensure_can_see_emails
|
||||
|
||||
def index
|
||||
screened_emails = ScreenedEmail.limit(200).order("last_match_at desc").to_a
|
||||
render_serialized(screened_emails, ScreenedEmailSerializer)
|
||||
@@ -11,4 +13,8 @@ class Admin::ScreenedEmailsController < Admin::StaffController
|
||||
screen.destroy!
|
||||
render json: success_json
|
||||
end
|
||||
|
||||
def ensure_can_see_emails
|
||||
guardian.ensure_can_see_emails!
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user