Skip to content

Commit

Permalink
SAK-50380 Samigo solve availabile mail sending for groups (#12850)
Browse files Browse the repository at this point in the history
  • Loading branch information
ottenhoff authored Sep 4, 2024
1 parent 00a6737 commit fee4944
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,12 @@ public void execute(String publishedId) {
}
} else if (StringUtils.equals(publishedAssessment.getAssessmentAccessControl().getReleaseTo(), "Selected Groups")){ //when there is a releaseTo setting that limits the access of the test
for (Object groupId : publishedAssessment.getReleaseToGroups().keySet().toArray()){ //loop through applicable group IDs
Set<String> groupUserUids = site.getGroup((String) groupId).getUsersIsAllowed(SamigoConstants.AUTHZ_TAKE_ASSESSMENT);
for (User groupUser : userDirectoryService.getUsers(groupUserUids)) {
Set<String> studentUserUids = site.getUsersIsAllowed(SamigoConstants.AUTHZ_TAKE_ASSESSMENT);
Set<String> groupUserUids = site.getGroup((String) groupId).getUsers();
// Intersection of studentUserUids and groupUserUids
studentUserUids.retainAll(groupUserUids);

for (User groupUser : userDirectoryService.getUsers(studentUserUids)) {
if (!isUserInException(publishedAssessment, groupUser.getId(), site)) {
log.debug("Calling send email notification: {}", groupUser.getId());
sendEmailNotification(site, publishedAssessment, groupUser, null);
Expand Down

0 comments on commit fee4944

Please sign in to comment.