Skip to content

Commit

Permalink
ClarinAuthorization passed, but vanilla not because of vanilla check …
Browse files Browse the repository at this point in the history
…- I added dtoken into vanilla authorization url and because of that the vanilla authorization will be passed.
  • Loading branch information
milanmajchrak committed Dec 20, 2023
1 parent bb8ed5f commit ac65119
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)]);
}),
Expand Down

0 comments on commit ac65119

Please sign in to comment.