Skip to content

Commit

Permalink
Send Authorization request if the User is not allowed to see restrict…
Browse files Browse the repository at this point in the history
…ed Item (#646)
  • Loading branch information
milanmajchrak authored May 7, 2024
1 parent 1c9851f commit a861c23
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ public void getDSObyIdentifier(HttpServletRequest request,
if (dso != null) {
// Convert and respond with a redirect to the object itself
DSpaceObjectRest dsor = converter.toRest(dso, utils.obtainProjection());
if (dsor == null) {
response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Authentication is required");
return;
}
URI link = linkTo(dsor.getController(), dsor.getCategory(),
English.plural(dsor.getType()))
.slash(dsor.getId()).toUri();
Expand Down

0 comments on commit a861c23

Please sign in to comment.