diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Indicator.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Indicator.java index 6446140a..de2ce9bd 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Indicator.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Indicator.java @@ -128,9 +128,9 @@ public final class Indicator implements Entity { this.thresholds = Utils.immutableListOf(thresholds); } - public Indicator(final Exam exam, final POSTMapper postParams) { + public Indicator(final Long examId, final POSTMapper postParams) { this.id = null; - this.examId = exam.id; + this.examId = examId; this.name = postParams.getString(Domain.INDICATOR.ATTR_NAME); this.type = postParams.getEnum(Domain.INDICATOR.ATTR_TYPE, IndicatorType.class); this.defaultColor = postParams.getString(Domain.INDICATOR.ATTR_COLOR); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamAPI_V1_Controller.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamAPI_V1_Controller.java index 4120f6b1..d3c7d614 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamAPI_V1_Controller.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamAPI_V1_Controller.java @@ -131,7 +131,8 @@ public class ExamAPI_V1_Controller { .map(this::createRunningExamInfo) .collect(Collectors.toList()); } else { - final Exam exam = this.examSessionService.getExamDAO().byPK(examId) + final Exam exam = this.examSessionService.getExamDAO() + .byPK(examId) .getOrThrow(); result = Arrays.asList(createRunningExamInfo(exam)); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamProctoringController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamProctoringController.java index 1be45e90..10a0efb1 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamProctoringController.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamProctoringController.java @@ -327,7 +327,7 @@ public class ExamProctoringController { this.authorizationService.checkRead(this.examSessionService .getExamDAO() - .byPK(examId) + .examGrantEntityByPK(examId) .getOrThrow()); } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/IndicatorController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/IndicatorController.java index 1548f22c..c5e4d833 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/IndicatorController.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/IndicatorController.java @@ -72,11 +72,10 @@ public class IndicatorController extends EntityController @Override protected Indicator createNew(final POSTMapper postParams) { final Long examId = postParams.getLong(Domain.INDICATOR.ATTR_EXAM_ID); - - return this.examDao - .byPK(examId) - .map(exam -> new Indicator(exam, postParams)) - .getOrThrow(); + if (examId == null) { + throw new RuntimeException("Missing exam model id from request parameter map!"); + } + return new Indicator(examId, postParams); } @Override @@ -120,7 +119,8 @@ public class IndicatorController extends EntityController return null; } - return this.examDao.byPK(entity.examId) + return this.examDao + .examGrantEntityByPK(entity.examId) .getOrThrow(); } diff --git a/src/main/resources/config/application-dev-ws.properties b/src/main/resources/config/application-dev-ws.properties index 277c15de..81ac2bc0 100644 --- a/src/main/resources/config/application-dev-ws.properties +++ b/src/main/resources/config/application-dev-ws.properties @@ -22,7 +22,7 @@ sebserver.webservice.clean-db-on-startup=false # webservice configuration sebserver.init.adminaccount.gen-on-init=false -sebserver.webservice.distributed=true +sebserver.webservice.distributed=false sebserver.webservice.master.delay.threshold=10000 sebserver.webservice.http.external.scheme=http sebserver.webservice.http.external.servername=localhost