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 ...@@ -9,6 +9,7 @@ class GlobalPolicy < BasePolicy
can! :log_in unless @user.access_locked? can! :log_in unless @user.access_locked?
can! :access_api can! :access_api
can! :access_git can! :access_git
can! :receive_notifications
end end
end end
end end
...@@ -465,7 +465,7 @@ class NotificationService ...@@ -465,7 +465,7 @@ class NotificationService
end end
users = users.to_a.compact.uniq users = users.to_a.compact.uniq
users = users.reject(&:blocked?) users = users.select { |u| u.can?(:receive_notifications) }
users.reject do |user| users.reject do |user|
global_notification_setting = user.global_notification_setting 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