Project

General

Profile

« Previous | Next » 

Revision 8192dbbb

Added by Stephen Benjamin over 9 years ago

fixes #7586, #7734, #7172 - user preferences for receiving mail notifications

Adds a framework for user-selectable mail notifications. The work is
still done in ActionMailer classes and launch by rake in cron, however a
wrapper called MailNotification is used to provide RBAC and make the
association with users.

Plugins may seed their own mail notifications, see
db/seeds.d/16-mail-notifications.rb for an example.

Authors:
Shlomi Zadok <>
Stephen Benjamin <>

(cherry picked from commit 3a36bdf6179cfb3207af623584c021addb674ffb)

View differences:

test/unit/usergroup_test.rb
refute_with_errors usergroup.destroy, usergroup, :base, /last admin user group/
end
test "receipients_for provides subscribers of notification recipients" do
users = [FactoryGirl.create(:user, :with_mail_notification), FactoryGirl.create(:user)]
notification = users[0].mail_notifications.first.name
usergroup = FactoryGirl.create(:usergroup)
usergroup.users << users
recipients = usergroup.recipients_for(notification)
assert_equal recipients, [users[0]]
end
# TODO test who can modify usergroup roles and who can assign users!!! possible privileges escalation
context 'external usergroups' do

Also available in: Unified diff