summaryrefslogtreecommitdiff
path: root/lib/gitlab/email/receiver.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-08-21 10:14:45 -0700
committerDouwe Maan <douwe@gitlab.com>2015-08-21 10:14:45 -0700
commit69708dab9f6e1c265dd2bf80eafc39bf68c356e0 (patch)
tree08ebea572ea31c46d77fdc7c24f729325279a25f /lib/gitlab/email/receiver.rb
parent35224d5e7f3e0c978640b7a6dd64e9778c4d1c60 (diff)
downloadgitlab-ce-69708dab9f6e1c265dd2bf80eafc39bf68c356e0.tar.gz
Block blocked users from replying to threads by email.reply-by-email
Diffstat (limited to 'lib/gitlab/email/receiver.rb')
-rw-r--r--lib/gitlab/email/receiver.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/gitlab/email/receiver.rb b/lib/gitlab/email/receiver.rb
index 17b8339edcd..355fbd27898 100644
--- a/lib/gitlab/email/receiver.rb
+++ b/lib/gitlab/email/receiver.rb
@@ -8,6 +8,7 @@ module Gitlab
class EmptyEmailError < ProcessingError; end
class AutoGeneratedEmailError < ProcessingError; end
class UserNotFoundError < ProcessingError; end
+ class UserBlockedError < ProcessingError; end
class UserNotAuthorizedError < ProcessingError; end
class NoteableNotFoundError < ProcessingError; end
class InvalidNoteError < ProcessingError; end
@@ -27,6 +28,8 @@ module Gitlab
raise UserNotFoundError unless author
+ raise UserBlockedError if author.blocked?
+
project = sent_notification.project
raise UserNotAuthorizedError unless project && author.can?(:create_note, project)