clarin-dspace icon indicating copy to clipboard operation
clarin-dspace copied to clipboard

Non-admin user with no READ permission for a bitstream, doesn't see any response when "Download file" button is clicked

Open kuchtiak-ufal opened this issue 5 months ago • 4 comments

As a submitter I've setup an Embargo for my item file (bitstream) until some date.

I am not able to download this file before that date, which is OK. But, I'd expect to see some information message that file is temporarily not available for download. The same for other non-admin user.

Instead, nothing is shown in Clarin-DSpace UI, only I can see some 403/401 messages in my Chrome devtools Network monitor:

Image

Error messages are:

GET server/api/core/bitstreams/b4fe4c99-9874-4b21-ba8f-13e7671dcb3e/bundle?embed=primaryBitstream&embed=item
{
    "timestamp": "2025-07-29T07:44:14.778+00:00",
    "status": 403,
    "error": "Forbidden",
    "message": "Access is denied",
    "path": "/server/api/core/bitstreams/b4fe4c99-9874-4b21-ba8f-13e7671dcb3e/bundle"
}

and

GET server/api/authrn/b4fe4c99-9874-4b21-ba8f-13e7671dcb3e
{
    "timestamp": "2025-07-29T07:44:14.781+00:00",
    "status": 401,
    "error": "Unauthorized",
    "message": "Authorization denied for action READ on BITSTREAM:b4fe4c99-9874-4b21-ba8f-13e7671dcb3e by user d6d42691-1cdb-4780-88b0-193bfcec347e",
    "path": "/server/api/authrn/b4fe4c99-9874-4b21-ba8f-13e7671dcb3e"
}

kuchtiak-ufal avatar Jul 29 '25 07:07 kuchtiak-ufal

This is partially related to https://github.com/ufal/clarin-dspace/issues/1172

kuchtiak-ufal avatar Jul 29 '25 07:07 kuchtiak-ufal

This is quite generic issue: When user has no READ permission for a bitstream, there's no any message shown in UI when user clicks "Download file" button.

Only the following error is visible in Network monitor:

GET server/api/authrn/b4fe4c99-9874-4b21-ba8f-13e7671dcb3e
{
    "timestamp": "2025-07-29T07:44:14.781+00:00",
    "status": 401,
    "error": "Unauthorized",
    "message": "Authorization denied for action READ on BITSTREAM:b4fe4c99-9874-4b21-ba8f-13e7671dcb3e by user d6d42691-1cdb-4780-88b0-193bfcec347e",
    "path": "/server/api/authrn/b4fe4c99-9874-4b21-ba8f-13e7671dcb3e"
}

I think, this is a bug. User has no idea why file cannot be downloaded.

This should be fixed in UI.

kuchtiak-ufal avatar Jul 29 '25 14:07 kuchtiak-ufal

Pull Request: https://github.com/ufal/dspace-angular/pull/42/

kuchtiak-ufal avatar Jul 30 '25 14:07 kuchtiak-ufal

Now, after the fix, the following message is shown for user with no download access:

Image

kuchtiak-ufal avatar Aug 05 '25 08:08 kuchtiak-ufal