Allow Creating dataset with default license via API regardless of allow custom terms setting#12551
Conversation
pdurbin
left a comment
There was a problem hiding this comment.
I say we make the improved behavior opt-out instead.
| - When set to `true`, the default license will be automatically assigned if no license and no terms are provided in the input JSON. | ||
| - When set to `false`, no license (and no terms) will be assigned if none are provided. | ||
| - When not set (the default), the system maintains backward compatibility: the default license is assigned if custom terms are not allowed; if custom terms are allowed, no license is assigned. |
There was a problem hiding this comment.
I think the default should be the new behavior: give the dataset the default license.
And sure, have a setting for opt-ing out of the new, better behavior, if we feel like it's valuable.
There was a problem hiding this comment.
Not sure what that would be called if it stays binary true/false. The two states when the new setting is set would then be:
- don't assume default license if custom terms are allowed
- never assume the default license
with always assume the default license being the new default. Any suggestions?
There was a problem hiding this comment.
You could reverse the logic and call it dataverse.api.allow-no-license
There was a problem hiding this comment.
~nevermind - the problem is only if we need to handle three states, but since any given instance either does/doesn't allow custom terms, there's no one who needs the current capability. I'll reactor...
…cense # Conflicts: # doc/sphinx-guides/source/installation/config.rst

What this PR does / why we need it: Dataverse currently creates an incomplete/invalid dataset with no license and no terms of use when a dataset is created by API, the user doesn't specify a license or terms, and the :AllowCustomTerms setting is true.
This PR adds a new JVM setting dataverse.api.assume-default-license-when-not-provided-via-api that allows forcing such a dataset to get the default license regardless of whether custom terms are allowed. One can also force datasets that do not specify a license to not be assigned the default even when terms aren't allowed, or keep the current behavior.
This serves two use cases:
Which issue(s) this PR closes:
Special notes for your reviewer:
Suggestions on how to test this: The basic logic is tested in the new JSON parser test. A Harvard use case for this is to set the new setting to true and assure that the HEAL bridge creates datasets with the default license when Dataverse is configured to allow custom terms. See #368. It would also be good to test that when custom terms aren't allowed, the UIs don't break when a dataset has no license (nominally we show a warning that a license or terms are needed when custom terms are allowed, it's possible that we don't handle this case).
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?: included
Additional documentation: