diff options
author | Mario de la Ossa <mariodelaossa@gmail.com> | 2018-05-03 15:32:20 -0600 |
---|---|---|
committer | Mario de la Ossa <mariodelaossa@gmail.com> | 2018-05-07 12:58:47 -0600 |
commit | 02741ca4c58c625070d06c248125b2f510ac2c0b (patch) | |
tree | 3bfc7684b2082ee73ceffc85868ef3dc2d307a21 /lib/gitlab/email/handler/reply_processing.rb | |
parent | 33e78f9ebd35b4132e9f18057f517d92cbefb9cd (diff) | |
download | gitlab-ce-02741ca4c58c625070d06c248125b2f510ac2c0b.tar.gz |
Backport 5480-epic-notifications from EE
Diffstat (limited to 'lib/gitlab/email/handler/reply_processing.rb')
-rw-r--r-- | lib/gitlab/email/handler/reply_processing.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab/email/handler/reply_processing.rb b/lib/gitlab/email/handler/reply_processing.rb index 32c5caf93e8..da5ff350549 100644 --- a/lib/gitlab/email/handler/reply_processing.rb +++ b/lib/gitlab/email/handler/reply_processing.rb @@ -32,8 +32,12 @@ module Gitlab def validate_permission!(permission) raise UserNotFoundError unless author raise UserBlockedError if author.blocked? - raise ProjectNotFound unless author.can?(:read_project, project) - raise UserNotAuthorizedError unless author.can?(permission, project) + + if project + raise ProjectNotFound unless author.can?(:read_project, project) + end + + raise UserNotAuthorizedError unless author.can?(permission, project || noteable) end def verify_record!(record:, invalid_exception:, record_name:) |