use of org.folio.circulation.support.http.server.BlockOverrideError in project mod-circulation by folio-org.
the class OverridingErrorHandler method extendOverridableErrors.
private ValidationErrorFailure extendOverridableErrors(ValidationErrorFailure validationFailure) {
final CirculationErrorType errorType = getErrors().get(validationFailure);
if (!OVERRIDABLE_ERROR_TYPES.containsKey(errorType)) {
return validationFailure;
}
OverridableBlockType blockType = OVERRIDABLE_ERROR_TYPES.get(errorType);
OkapiPermissions missingOverridePermissions = blockType.getMissingOverridePermissions(okapiPermissions);
return new ValidationErrorFailure(validationFailure.getErrors().stream().map(error -> new BlockOverrideError(error, blockType, missingOverridePermissions)).collect(toList()));
}
Aggregations