diff options
author | Valery Sizov <valery@gitlab.com> | 2016-10-04 15:52:08 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2016-10-11 16:51:26 +0300 |
commit | b4004488f76d7360acd2f38277d617447c76b888 (patch) | |
tree | d52552cccf8b51ba4e099f0afbb05bf94a1a1472 /app/services/notification_service.rb | |
parent | a3169d522a0db269770141a1b30c3df5acee82f3 (diff) |
Make guests unable to view MRs
Diffstat (limited to 'app/services/notification_service.rb')
-rw-r--r-- | app/services/notification_service.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index de8049b8e2e..72712afc07e 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -475,10 +475,12 @@ class NotificationService end def reject_users_without_access(recipients, target) - return recipients unless target.is_a?(Issue) + return recipients unless target.is_a?(Issuable) + + ability = :"read_#{target.to_ability_name}" recipients.select do |user| - user.can?(:read_issue, target) + user.can?(ability, target) end end |