use of org.finos.waltz.web.NotAuthorizedException in project waltz by khartec.
the class AssessmentRatingEndpoint method verifyCanWrite.
private void verifyCanWrite(Request request, long defId) {
AssessmentDefinition def = assessmentDefinitionService.getById(defId);
def.permittedRole().ifPresent(r -> requireRole(userRoleService, request, r));
if (def.isReadOnly()) {
throw new NotAuthorizedException("Assessment is read-only");
}
}
Aggregations