Skip to content

Commit

Permalink
Merge pull request #2261 from Siemens-Healthineers/fix/import-endpoin…
Browse files Browse the repository at this point in the history
…t-error-msg-when-user-dont-have-import-permissions

fix(rest): error handling when user dont have sufficient import permission
  • Loading branch information
arunazhakesan committed Jan 29, 2024
2 parents d77beb5 + 222879a commit ecce96c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,10 @@ public ResponseEntity<?> importSBOM(
if (requestSummary.getRequestStatus() == RequestStatus.FAILURE) {
return new ResponseEntity<String>(requestSummary.getMessage(), HttpStatus.BAD_REQUEST);
}
else if(requestSummary.getRequestStatus() == RequestStatus.ACCESS_DENIED){
return new ResponseEntity<String>("You do not have sufficient permissions.", HttpStatus.UNAUTHORIZED);
}

String jsonMessage = requestSummary.getMessage();
messageMap = new Gson().fromJson(jsonMessage, Map.class);
projectId = messageMap.get("projectId");
Expand Down

0 comments on commit ecce96c

Please sign in to comment.