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)]); }),