From ac65119bccc7d7a98ffe23a48a2a72f6c7dea769 Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Wed, 20 Dec 2023 15:54:58 +0100 Subject: [PATCH] ClarinAuthorization passed, but vanilla not because of vanilla check - I added dtoken into vanilla authorization url and because of that the vanilla authorization will be passed. --- .../clarin-bitstream-download-page.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/bitstream-page/clarin-bitstream-download-page/clarin-bitstream-download-page.component.ts b/src/app/bitstream-page/clarin-bitstream-download-page/clarin-bitstream-download-page.component.ts index b9e5c356b35..f9b0700fb2f 100644 --- a/src/app/bitstream-page/clarin-bitstream-download-page/clarin-bitstream-download-page.component.ts +++ b/src/app/bitstream-page/clarin-bitstream-download-page/clarin-bitstream-download-page.component.ts @@ -85,7 +85,9 @@ export class ClarinBitstreamDownloadPageComponent implements OnInit { this.requestService.send(headRequest); const clarinIsAuthorized$ = this.rdbService.buildFromRequestUUID(requestId); - const isAuthorized$ = this.authorizationService.isAuthorized(FeatureID.CanDownload, isNotEmpty(bitstream) ? bitstream.self : undefined); + // Clarin authorization check into dtoken parameter from the request + const dtoken = isNotEmpty(this.dtoken) ? '?dtoken=' + this.dtoken : ''; + const isAuthorized$ = this.authorizationService.isAuthorized(FeatureID.CanDownload, isNotEmpty(bitstream) ? bitstream.self + dtoken : undefined); const isLoggedIn$ = this.auth.isAuthenticated(); return observableCombineLatest([clarinIsAuthorized$, isAuthorized$, isLoggedIn$, observableOf(bitstream)]); }),