diff --git a/doc/release-notes/359-enhance-publishing-message-acknowledgement.md b/doc/release-notes/359-enhance-publishing-message-acknowledgement.md new file mode 100644 index 00000000000..c8c4b53828b --- /dev/null +++ b/doc/release-notes/359-enhance-publishing-message-acknowledgement.md @@ -0,0 +1,19 @@ +## Publishing Enhancement ## + +Before a Dataset can be published the user must acknowledge acceptance of the disclaimer if it is required. + +The setting "PublishDatasetDisclaimer", when set, will prevent a draft dataset from being published without the user acknowledging the disclaimer. +The approved disclaimer text is `"By publishing this dataset, I fully accept all legal responsibility for ensuring that the deposited content is: anonymized, free of copyright violations, and contains data that is computationally reusable. I understand and agree that any violation of these conditions may result in the immediate removal of the dataset by the repository without prior notice."` + +To enable/disable the acknowledgement requirement an Admin can set/delete the setting using the following APIs: + +`curl -X PUT -d "By publishing this dataset, I fully accept all legal responsibility for ensuring that the deposited content is: anonymized, free of copyright violations, and contains data that is computationally reusable. I understand and agree that any violation of these conditions may result in the immediate removal of the dataset by the repository without prior notice." http://localhost:8080/api/admin/settings/:PublishDatasetDisclaimer` + +`curl -X DELETE http://localhost:8080/api/admin/settings/:PublishDatasetDisclaimer` + +The UI will prevent the user from publishing a Dataset unless the disclaimer is acknowledged. + +The APIs will continue to publish without the acknowledgement for now. + +See: +- [#359](https://github.com/IQSS/dataverse.harvard.edu/issues/359) diff --git a/doc/sphinx-guides/source/installation/config.rst b/doc/sphinx-guides/source/installation/config.rst index c70611588da..ef6c00d71d4 100644 --- a/doc/sphinx-guides/source/installation/config.rst +++ b/doc/sphinx-guides/source/installation/config.rst @@ -5279,6 +5279,15 @@ This post-publish workflow is useful for actions such as sending notifications a See :ref:`Workflow Admin section ` for more details and context. +.. _:PublishDatasetDisclaimer: + +:PublishDatasetDisclaimer ++++++++++++++++++++++++++ + +The text displayed to the user that must be acknowledged prior to publishing a Dataset. When not set the acknowledgment is not required nor displayed. + +``curl -X PUT -d "By publishing this dataset, I fully accept all legal responsibility for ensuring that the deposited content is: anonymized, free of copyright violations, and contains data that is computationally reusable. I understand and agree that any violation of these conditions may result in the immediate removal of the dataset by the repository without prior notice." http://localhost:8080/api/admin/settings/:PublishDatasetDisclaimer`` + .. _:BagItHandlerEnabled: :BagItHandlerEnabled diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java index 20617160a1c..febe1dfe287 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java @@ -1,8 +1,5 @@ package edu.harvard.iq.dataverse; -import edu.harvard.iq.dataverse.authorization.DataverseRole; -import edu.harvard.iq.dataverse.engine.command.DataverseRequest; -import edu.harvard.iq.dataverse.globus.Permissions; import edu.harvard.iq.dataverse.provenance.ProvPopupFragmentBean; import edu.harvard.iq.dataverse.api.AbstractApiBean; import edu.harvard.iq.dataverse.authorization.AuthenticationServiceBean; @@ -6251,6 +6248,7 @@ public void setFileMetadataForAction(FileMetadata fileMetadataForAction) { private String termsOfAccess; private boolean fileAccessRequest; + private boolean publishDisclaimerAcknowledged; public String getTermsOfAccess() { return termsOfAccess; @@ -6268,6 +6266,14 @@ public void setFileAccessRequest(boolean fileAccessRequest) { this.fileAccessRequest = fileAccessRequest; } + public boolean isPublishDisclaimerAcknowledged() { + return publishDisclaimerAcknowledged || !settingsWrapper.isHasPublishDatasetDisclaimer(); + } + + public void setPublishDisclaimerAcknowledged(boolean publishDisclaimerAcknowledged) { + this.publishDisclaimerAcknowledged = publishDisclaimerAcknowledged; + } + // wrapper method to see if the file has been deleted (or replaced) in the current version public boolean isFileDeleted (DataFile dataFile) { if (dataFile.getDeleted() == null) { diff --git a/src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java b/src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java index 23a26a8cf2c..d16a36f2e3a 100644 --- a/src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java +++ b/src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java @@ -124,7 +124,9 @@ public class SettingsWrapper implements java.io.Serializable { private Boolean webloaderUpload = null; - private String metricsUrl = null; + private String metricsUrl = null; + + private String publishDatasetDisclaimer = null; private Boolean dataFilePIDSequentialDependent = null; @@ -872,4 +874,15 @@ public List getSystemMetadataBlocks() { return systemMetadataBlocks; } -} \ No newline at end of file + + public String getPublishDatasetDisclaimer() { + if (publishDatasetDisclaimer == null) { + publishDatasetDisclaimer = getValueForKey(Key.PublishDatasetDisclaimer); + } + return publishDatasetDisclaimer; + } + + public Boolean isHasPublishDatasetDisclaimer() { + return !StringUtil.isEmpty(getPublishDatasetDisclaimer()); + } +} diff --git a/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java index 965f0dd9740..bca1d1f6006 100644 --- a/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java @@ -326,6 +326,10 @@

Size limit (in bytes) for tabular file ingest. Accepts either a single numeri */ DatasetPublishPopupCustomTextOnAllVersions, /* + Publish Disclaimer text. If this setting exists user must acknowledge before a Dataset can be published + */ + PublishDatasetDisclaimer, + /* Whether Harvesting (OAI) service is enabled */ OAIServerEnabled, diff --git a/src/main/webapp/dataset.xhtml b/src/main/webapp/dataset.xhtml index 0b16e63ac94..9d03165b4ad 100644 --- a/src/main/webapp/dataset.xhtml +++ b/src/main/webapp/dataset.xhtml @@ -2029,8 +2029,18 @@

#{bundle['dataset.publish.terms.help.tip']}

+ +
+ + + +
+
-