Skip to content
Snippets Groups Projects
Commit f7a111e9 authored by http://jneen.net/'s avatar http://jneen.net/
Browse files

use policies to protect sending email

parent bb0cba92
No related branches found
No related tags found
Loading
Loading
Loading
@@ -9,6 +9,7 @@ class GlobalPolicy < BasePolicy
can! :log_in unless @user.access_locked?
can! :access_api
can! :access_git
can! :receive_notifications
end
end
end
Loading
Loading
@@ -465,7 +465,7 @@ class NotificationService
end
 
users = users.to_a.compact.uniq
users = users.reject(&:blocked?)
users = users.select { |u| u.can?(:receive_notifications) }
 
users.reject do |user|
global_notification_setting = user.global_notification_setting
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment