diff options
-rw-r--r-- | app/policies/global_policy.rb | 1 | ||||
-rw-r--r-- | app/services/notification_service.rb | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/app/policies/global_policy.rb b/app/policies/global_policy.rb index e1a527b95bf..cb72c2b4590 100644 --- a/app/policies/global_policy.rb +++ b/app/policies/global_policy.rb @@ -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 diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index fbad85d310e..d12692ecc90 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -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 |