diff --git a/src/main/java/edu/harvard/iq/dataverse/EditDatafilesPage.java b/src/main/java/edu/harvard/iq/dataverse/EditDatafilesPage.java index 8a104d1ddd0..3c3da259f75 100644 --- a/src/main/java/edu/harvard/iq/dataverse/EditDatafilesPage.java +++ b/src/main/java/edu/harvard/iq/dataverse/EditDatafilesPage.java @@ -729,6 +729,16 @@ public void setShowAccessPopup(boolean showAccessPopup) {} // dummy set method //fails silently. This is because they are only granted editDataset permissions //for that scope after the creation is completed. -Matthew 4.7.1 public void restrictFiles(boolean restricted) throws UnsupportedOperationException{ + + //First make sure they've even selected file(s) to restrict.... + if (this.getSelectedFiles().isEmpty()) { + if (restricted) { + PrimeFaces.current().executeScript("PF('selectFilesForRestrictEditFilesPage').show()"); + } else { + PrimeFaces.current().executeScript("PF('selectFilesForUnRestrictEditFilesPage').show()"); + } + return; + } // since we are restricted files, first set the previously restricted file list, so we can compare for // determining whether to show the access popup diff --git a/src/main/webapp/editdatafiles.xhtml b/src/main/webapp/editdatafiles.xhtml index 2830052ee74..0ebee857a42 100644 --- a/src/main/webapp/editdatafiles.xhtml +++ b/src/main/webapp/editdatafiles.xhtml @@ -88,6 +88,24 @@ + +

#{bundle['dataset.noSelectedFilesForRestrict']}

+
+ +
+
+ +

#{bundle['dataset.noSelectedFilesForUnRestrict']}

+
+ +
+