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

use policies to protect sending email

parent bb0cba92
......@@ -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
......@@ -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
......
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