Skip to content

Commit

Permalink
Users can only download the RO-Crate if they have access to all the f…
Browse files Browse the repository at this point in the history
…iles in the Dataset - refs #11195
  • Loading branch information
fintanorbert committed Nov 8, 2024
1 parent c3dfc95 commit 197073f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/propertyFiles/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2978,7 +2978,7 @@ arp.rocrate.version.save.error=Failed to save the current version of the RO-Crat
arp.rocrate.draft.deletion.error=Failed to delete the "Draft" version of the RO-Crate
arp.dataverse.results.btn.addData.newRoCrate=New Ro-Crate
arp.dataset.roCrate.too.big=The dataset is too large to download in RO-Crate format.
arp.dataset.roCrate.too.big.simple=The file download limit is: {0}.<br/>Please select the files you need from the files table.<br/> Only the <b>{1}</b> will be downloaded.
arp.dataset.roCrate.too.big.simple=The file download limit is: {0}.<br/>Please select the files you need from the files table.<br/> Only the <b>{1}</b> and the <b>{2}</b> will be downloaded.
dataset.describoTab=AROMA
dataset.message.roCrateSuccess=The RO-Crate for this dataset has been updated.
dataset.message.roCrateError=Something went wrong during saving the RO-Crate for this dataset.
Expand All @@ -2997,4 +2997,6 @@ arp.rocrate.is.missing=Missing \"{0}\". Please ensure that your RO-Crate.zip con
arp.rocrate.is.missing.summary=Upload Error
arp.file.dataFilesTab.terms.list.license=Agree to ARP General Terms of Use
arp.file.dataFilesTab.terms.list.license.view.description= I have read, understood and accept the <a href="https://researchdata.hu/altalanos-felhasznalasi-feltetelek" title="ARP General Terms of Use" target="_blank">General Terms of Use</a> of the ARP Data Repository and I take responsibility for compliance with the terms and conditions contained therein.
arp.dataset.publish.cc.license.accept=I have read, understood and accept the terms of the&nbsp;<a href="https://creativecommons.org/share-your-work/cclicenses/" title="Creative Commons Licenses" target="_blank">Creative Commons Licenses</a>.
arp.dataset.publish.cc.license.accept=I have read, understood and accept the terms of the&nbsp;<a href="https://creativecommons.org/share-your-work/cclicenses/" title="Creative Commons Licenses" target="_blank">Creative Commons Licenses</a>.
arp.dataset.inValidSelectedFilesForDownload=Restricted Files in the RO-Crate
arp.dataset.noValidSelectedFilesForDownload=The file(s) in the RO-Crate may not be downloaded because you have not been granted access.
18 changes: 18 additions & 0 deletions src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,13 @@
action="#{DatasetPage.downloadRoCrate()}"
ajax="false"
/>-->
<!-- If the RO-Crate is not downloadable, because some files are restricted for the user. -->
<p:commandLink styleClass="btn btn-default btn-access" onclick="PF('roCrateDownloadInvalid').show();"
rendered="#{!DatasetPage.canDownloadRoCrate() and !(empty DatasetPage.workingVersion.fileMetadatas) and !DatasetPage.tooLargeToDownloadArchival and (!widgetWrapper.widgetView
and (empty DatasetPage.editMode and !widgetWrapper.widgetView))}"
disabled="#{DatasetPage.dataset.hasJsonCrate(DatasetPage.workingVersion.getFriendlyVersionNumber())}">
#{bundle['file.dataFilesTab.metadata.downloadRoCrate']}
</p:commandLink>
<!-- If the RO-Crate is downloadable and contains files, this button will download the RO-Crate with the files. -->
<p:commandLink styleClass="btn btn-default btn-access" actionListener="#{DatasetPage.setRoCrateDownload(true)}" oncomplete="PF('guestbookAndTermsPopup').show();"
update=":datasetForm:guestbookAndTermsPopup"
Expand Down Expand Up @@ -1172,6 +1179,17 @@
</button>
</div>
</p:dialog>
<p:dialog id="roCrateDownloadInvalid" styleClass="smallPopUp" header="#{bundle['arp.dataset.inValidSelectedFilesForDownload']}" widgetVar="roCrateDownloadInvalid" modal="true">
<p class="text-danger"><span class="glyphicon glyphicon-exclamation-sign"/> #{bundle['arp.dataset.noValidSelectedFilesForDownload']}</p>
<ui:fragment rendered="#{DatasetPage.dataset.fileAccessRequest}">
<p class="help-block">#{bundle['dataset.requestAccessToRestrictedFiles']}</p>
</ui:fragment>
<div class="button-block">
<button class="btn btn-default" onclick="PF('roCrateDownloadInvalid').hide();" type="button">
#{bundle.close}
</button>
</div>
</p:dialog>
<p:dialog id="deleteConfirmation" styleClass="smallPopUp" header="#{bundle['file.deleteDialog.header']}" widgetVar="deleteConfirmation" modal="true">
<p class="text-warning"><span class="glyphicon glyphicon-warning-sign"/> #{bundle['file.deleteDialog.tip']}</p>
<div class="button-block">
Expand Down

0 comments on commit 197073f

Please sign in to comment.