diff options
Diffstat (limited to 'app/presenters/issue_email_participant_presenter.rb')
-rw-r--r-- | app/presenters/issue_email_participant_presenter.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/presenters/issue_email_participant_presenter.rb b/app/presenters/issue_email_participant_presenter.rb new file mode 100644 index 00000000000..8688b9a2af1 --- /dev/null +++ b/app/presenters/issue_email_participant_presenter.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class IssueEmailParticipantPresenter < Gitlab::View::Presenter::Delegated + presents ::IssueEmailParticipant, as: :participant + + delegator_override :email + def email + return super if Ability.allowed?(current_user, :read_external_emails, participant.issue.project) + + Gitlab::Utils::Email.obfuscated_email(super, deform: true) + end +end |