Index: main/plugin-cms/plugin.xml =================================================================== --- main/plugin-cms/plugin.xml (revision 43460) +++ main/plugin-cms/plugin.xml (working copy) @@ -346,6 +346,10 @@ + + + + + + + + + users = new HashSet<>(); for (String right : _instantAlertRights) { - users.addAll(_rightManager.getAllowedUsers(right, content)); + users.addAll(_rightManager.getAllowedUsers(right, content).actualAllowedUsers(Config.getInstance().getValueAsBoolean("runtime.mail.massive.sending"))); } List params = _getInstantAlertParams(content, message); @@ -562,7 +562,7 @@ Set users = new HashSet<>(); for (String right : _awaitingValidationRights) { - users.addAll(_rightManager.getAllowedUsers(right, content)); + users.addAll(_rightManager.getAllowedUsers(right, content).actualAllowedUsers(Config.getInstance().getValueAsBoolean("runtime.mail.massive.sending"))); } List params = _getAwaitingValidationParams(content); @@ -586,7 +586,7 @@ Set users = new HashSet<>(); for (String right : _unmodifiedContentRights) { - users.addAll(_rightManager.getAllowedUsers(right, content)); + users.addAll(_rightManager.getAllowedUsers(right, content).actualAllowedUsers(Config.getInstance().getValueAsBoolean("runtime.mail.massive.sending"))); } List params = _getUnmodifiedContentParams(content); @@ -610,7 +610,7 @@ Set users = new HashSet<>(); for (String right : _reminderRights) { - users.addAll(_rightManager.getAllowedUsers(right, content)); + users.addAll(_rightManager.getAllowedUsers(right, content).actualAllowedUsers(Config.getInstance().getValueAsBoolean("runtime.mail.massive.sending"))); } List params = _getReminderParams(content); @@ -634,7 +634,7 @@ Set users = new HashSet<>(); for (String right : _scheduledArchivingReminderRights) { - users.addAll(_rightManager.getAllowedUsers(right, content)); + users.addAll(_rightManager.getAllowedUsers(right, content).actualAllowedUsers(Config.getInstance().getValueAsBoolean("runtime.mail.massive.sending"))); } List params = _getScheduledArchivingReminderParams(content); Index: main/plugin-cms/src/org/ametys/cms/content/consistency/ContentConsistencyEngine.java =================================================================== --- main/plugin-cms/src/org/ametys/cms/content/consistency/ContentConsistencyEngine.java (revision 43460) +++ main/plugin-cms/src/org/ametys/cms/content/consistency/ContentConsistencyEngine.java (working copy) @@ -344,7 +344,7 @@ */ protected void _sendErrorEmail() throws IOException { - Set users = _rightManager.getAllowedUsers(_MAIL_RIGHT, "/contributor"); + Set users = _rightManager.getAllowedUsers(_MAIL_RIGHT, "/contributor").actualAllowedUsers(Config.getInstance().getValueAsBoolean("runtime.mail.massive.sending")); Map params = _getEmailParams(); Index: main/plugin-cms/src/org/ametys/cms/workflow/SendMailFunction.java =================================================================== --- main/plugin-cms/src/org/ametys/cms/workflow/SendMailFunction.java (revision 43460) +++ main/plugin-cms/src/org/ametys/cms/workflow/SendMailFunction.java (working copy) @@ -263,13 +263,13 @@ // First right : add all the granted users. if (rightIt.hasNext()) { - users.addAll(_rightManager.getAllowedUsers(rightIt.next(), content)); + users.addAll(_rightManager.getAllowedUsers(rightIt.next(), content).actualAllowedUsers(Config.getInstance().getValueAsBoolean("runtime.mail.massive.sending"))); } // Next rights : retain all the granted users. while (rightIt.hasNext()) { - users.retainAll(_rightManager.getAllowedUsers(rightIt.next(), content)); + users.retainAll(_rightManager.getAllowedUsers(rightIt.next(), content).actualAllowedUsers(Config.getInstance().getValueAsBoolean("runtime.mail.massive.sending"))); } return users; Index: main/plugin-cms/src/org/ametys/cms/workflow/archive/ArchiveContentsEngine.java =================================================================== --- main/plugin-cms/src/org/ametys/cms/workflow/archive/ArchiveContentsEngine.java (revision 43460) +++ main/plugin-cms/src/org/ametys/cms/workflow/archive/ArchiveContentsEngine.java (working copy) @@ -440,7 +440,7 @@ Set users = new HashSet<>(); for (String right : _archiveRights) { - users.addAll(_rightManager.getAllowedUsers(right, content)); + users.addAll(_rightManager.getAllowedUsers(right, content).actualAllowedUsers(Config.getInstance().getValueAsBoolean("runtime.mail.massive.sending"))); } return users; Index: test/environment/config.xml =================================================================== --- test/environment/config.xml (revision 43460) +++ test/environment/config.xml (working copy) @@ -31,6 +31,7 @@ test@ametys.org ametys@ametys.org + true true