Commit 80647364 authored by http://jneen.net/'s avatar http://jneen.net/

move the ability check to reject_users_without_access

parent 57aa5d63
......@@ -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}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment