-
Notifications
You must be signed in to change notification settings - Fork 530
Update Dataset License API #11815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Update Dataset License API #11815
Conversation
… pending command impl
…taset-license-api
…ved to AbstractApiBean
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
📦 Pushed preview images as
🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
return ok(BundleUtil.getStringFromBundle("datasets.api.updateLicense.success")); | ||
} else if (requestBody.getCustomTerms() != null) { | ||
CustomTermsDTO customTerms = requestBody.getCustomTerms(); | ||
execCommand(new UpdateDatasetLicenseCommand(req, dataset, customTerms.toTermsOfUseAndAccess())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't do anything to preserve whatever has been entered for File Access Requests or Terms of Access so it will fail if the dataset has any restricted files. In the absence of restricted files would we still want to wipe out whatever may have been entered with respect to data file access?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or the other TermsOfUseAndAccess fields (originalArchive, sizeOfCollection, ...).
@GPortas please take a look at how the setting of custom terms of will delete any entries in custom terms of access. I ended up reworking #11772 so that the api will only modify the terms of access and leave the license or custom terms of use the same as they were prior to the update. A more radical approach would have been to split the terms of use and access tables into two tables but that seemed like too much to take on here. |
What this PR does / why we need it:
New Endpoint:
/datasets/{id}/license
A new endpoint has been implemented to manage dataset licenses.
Functionality
Usage
This endpoint supports two ways of defining a license:
CC BY 4.0
).customTerms
object.termsOfUse
, which is required.Which issue(s) this PR closes:
Suggestions on how to test this:
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X PUT "https://demo.dataverse.org/api/datasets/<dataset_id>/license" -H "Content-type:application/json" --upload-file <json_file_path>
To set a predefined license (e.g., CC BY 4.0), provide a JSON body with the license name:
To define custom terms of use and access, provide a JSON body with the following properties. All fields within
customTerms
are optional, except for thetermsOfUse
field, which is required:Does this PR introduce a user interface change? If mockups are available, please link/include them here:
None
Is there a release notes update needed for this change?:
Attached