diff options
author | http://jneen.net/ <jneen@jneen.net> | 2017-07-19 21:17:29 +0300 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2017-08-03 19:06:15 +0300 |
commit | 80647364ffaad3d100c64dd8a1ab32e8a9b4bcf9 (patch) | |
tree | d0d289fe54350114a1ca5392a3beca3b7db4df62 /app/services | |
parent | 57aa5d631466e5e2431e54fa450c61b4f1a3ee90 (diff) |
move the ability check to reject_users_without_access
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/notification_recipient_service.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/services/notification_recipient_service.rb b/app/services/notification_recipient_service.rb index 9ac561e4bd2..1abf0335dc4 100644 --- a/app/services/notification_recipient_service.rb +++ b/app/services/notification_recipient_service.rb @@ -253,7 +253,6 @@ class NotificationRecipientService end users = users.to_a.compact.uniq - users = users.select { |u| u.can?(:receive_notifications) } users.reject do |user| global_notification_setting = user.global_notification_setting @@ -287,6 +286,8 @@ class NotificationRecipientService end def reject_users_without_access(recipients, target) + recipients = recipients.select { |u| u.can?(:receive_notifications) } + ability = case target when Issuable :"read_#{target.to_ability_name}" |