Skip to content

Commit

Permalink
validate profile for retrieve set metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
GordeaS authored and GordeaS committed Jul 17, 2024
1 parent 21d4d6e commit 1465632
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ public ResponseEntity<String> getUserSet(
Integer pageItems=null;
//if no pagination requested, apply minimal profile (profiles deprecation)
if(isSetMetadataResponse(page)) {
List<LdProfiles> profiles = getProfiles(profile, request);
if(profiles.contains(LdProfiles.ITEMDESCRIPTIONS) || profiles.contains(LdProfiles.STANDARD)) {
//only minimal allow when retrieving metadata
throw new ParamValidationException(I18nConstants.INVALID_PARAM_VALUE,
I18nConstants.INVALID_PARAM_VALUE, new String[] {CommonApiConstants.QUERY_PARAM_PROFILE, profile});
}
profile=CommonApiConstants.PROFILE_MINIMAL;
} else {
pageNr = parseIntegerParam(CommonApiConstants.QUERY_PARAM_PAGE, page, -1, UserSetUtils.DEFAULT_PAGE);
Expand All @@ -177,6 +183,11 @@ public ResponseEntity<String> getUserSet(
authentication);
}

private void verifyProfileForRetrieveSet(String profile) {
// TODO Auto-generated method stub

}

private Integer parseIntegerParam(String paramName, String paramValue, int maxValue, int minValue)
throws ParamValidationException {
if(paramValue!=null) {
Expand Down

0 comments on commit 1465632

Please sign in to comment.