@@ -9,14 +9,16 @@ import { FileSectionComponent } from '../../../simple/field-components/file-sect
99import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model' ;
1010import { PaginatedList } from '../../../../core/data/paginated-list.model' ;
1111import { RemoteData } from '../../../../core/data/remote-data' ;
12- import { switchMap , tap } from 'rxjs/operators' ;
12+ import { map , switchMap , tap } from 'rxjs/operators' ;
1313import { NotificationsService } from '../../../../shared/notifications/notifications.service' ;
1414import { TranslateService } from '@ngx-translate/core' ;
1515import { hasValue , isEmpty } from '../../../../shared/empty.util' ;
1616import { PaginationService } from '../../../../core/pagination/pagination.service' ;
1717import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service' ;
1818import { AppConfig , APP_CONFIG } from 'src/config/app-config.interface' ;
1919import { UUIDService } from '../../../../core/shared/uuid.service' ;
20+ import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service' ;
21+ import { FeatureID } from '../../../../core/data/feature-authorization/feature-id' ;
2022
2123/**
2224 * This component renders the file section of the item
@@ -56,6 +58,7 @@ export class FullFileSectionComponent extends FileSectionComponent implements On
5658 protected paginationService : PaginationService ,
5759 public dsoNameService : DSONameService ,
5860 protected uuidService : UUIDService ,
61+ public authorizationService : AuthorizationDataService ,
5962 @Inject ( APP_CONFIG ) protected appConfig : AppConfig
6063 ) {
6164 super ( bitstreamDataService , notificationsService , translateService , dsoNameService , appConfig ) ;
@@ -112,6 +115,12 @@ export class FullFileSectionComponent extends FileSectionComponent implements On
112115 return bitstream ?. allMetadataValues ( 'bitstream.viewer.provider' ) . includes ( 'nodownload' ) ;
113116 }
114117
118+ canDownload ( file : Bitstream ) : Observable < boolean > {
119+ return this . authorizationService . isAuthorized ( FeatureID . CanDownload , file . self ) . pipe (
120+ map ( value => ! value ) ,
121+ ) ;
122+ }
123+
115124 ngOnDestroy ( ) : void {
116125 this . paginationService . clearPagination ( this . originalOptions . id ) ;
117126 this . paginationService . clearPagination ( this . licenseOptions . id ) ;
0 commit comments