Search in sources :

Example 1 with NotAuthorizedException

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");
    }
}
Also used : AssessmentDefinition(org.finos.waltz.model.assessment_definition.AssessmentDefinition) NotAuthorizedException(org.finos.waltz.web.NotAuthorizedException)

Aggregations

AssessmentDefinition (org.finos.waltz.model.assessment_definition.AssessmentDefinition)1 NotAuthorizedException (org.finos.waltz.web.NotAuthorizedException)1