Skip to content

Commit

Permalink
Updated docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmajchrak committed Nov 13, 2023
1 parent 04b9212 commit f76ac73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ public boolean authorizeBitstream(Context context, Bitstream bitstream) throws S
}

/**
* Check if the current user is authorized to download the bitstream.
* Do not allow download for anonymous users. Allow it only if the bitstream has Clarin License and the license has
* confirmation = 3 (allow anonymous).
*
* @param context DSpace context object
* @param bitstreamID downloading Bitstream UUID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public ResponseEntity authrn(@PathVariable String id, HttpServletResponse respon
return null;
}

// If the bitstream license is not allowed for anonymous and the user is not signed in redirect the user
// to the login page
// Do not allow download for anonymous users. Allow it only if the bitstream has Clarin License and the license
// has confirmation = 3 (allow anonymous).
if (!authorizationBitstreamUtils.authorizeLicenseWithUser(context, bitstream.getID())) {
response.sendError(HttpStatus.UNAUTHORIZED.value(),
"Anonymous user cannot download this bitstream");
Expand Down

0 comments on commit f76ac73

Please sign in to comment.