From 45969934c378c1ba2a4dc5fd2b639d1cddd6f5ed Mon Sep 17 00:00:00 2001 From: anhefti Date: Thu, 20 Jun 2024 10:41:18 +0200 Subject: [PATCH] SEBSERV-417 fix teacher account selection for supporter --- .../webservice/weblayer/api/ExamAdministrationController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamAdministrationController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamAdministrationController.java index 49a05154..0f367246 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamAdministrationController.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamAdministrationController.java @@ -15,6 +15,7 @@ import java.util.stream.Collectors; import javax.validation.Valid; import ch.ethz.seb.sebserver.gbl.model.Activatable; +import ch.ethz.seb.sebserver.gbl.model.user.UserInfo; import ch.ethz.seb.sebserver.gbl.util.Cryptor; import ch.ethz.seb.sebserver.webservice.servicelayer.exam.ExamImportService; import ch.ethz.seb.sebserver.webservice.servicelayer.exam.ExamUtils; @@ -682,7 +683,7 @@ public class ExamAdministrationController extends EntityController { this.authorization.getUserService().getCurrentUser().getUserInfo().institutionId, true) .map(users -> users.stream() - .filter(user -> user.getRoles().contains(UserRole.EXAM_SUPPORTER.name())) + .filter(user -> user.hasAnyRole(UserRole.EXAM_SUPPORTER, UserRole.TEACHER)) .map(user -> user.uuid) .collect(Collectors.toSet())) .getOrThrow();