Skip to content

Commit ed6b37c

Browse files
Merge branch 'develop' into 11828-unacceptable-performance-deleting-datasets
2 parents 47e526f + ad031a9 commit ed6b37c

File tree

61 files changed

+2701
-369
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2701
-369
lines changed

.github/workflows/deploy_beta_testing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: echo "war_file=$(ls *.war | head -1)">> $GITHUB_ENV
3737

3838
- name: Upload war artifact
39-
uses: actions/upload-artifact@v4
39+
uses: actions/upload-artifact@v5
4040
with:
4141
name: built-app
4242
path: ./target/${{ env.war_file }}
@@ -50,7 +50,7 @@ jobs:
5050
- uses: actions/checkout@v5
5151

5252
- name: Download war artifact
53-
uses: actions/download-artifact@v5
53+
uses: actions/download-artifact@v6
5454
with:
5555
name: built-app
5656
path: ./

.github/workflows/maven_unit_test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262

6363
# Upload the built war file. For download, it will be wrapped in a ZIP by GitHub.
6464
# See also https://github.com/actions/upload-artifact#zipped-artifact-downloads
65-
- uses: actions/upload-artifact@v4
65+
- uses: actions/upload-artifact@v5
6666
with:
6767
name: dataverse-java${{ matrix.jdk }}.war
6868
path: target/dataverse*.war
@@ -72,7 +72,7 @@ jobs:
7272
- run: |
7373
tar -cvf java-builddir.tar target
7474
tar -cvf java-m2-selection.tar ~/.m2/repository/io/gdcc/dataverse-*
75-
- uses: actions/upload-artifact@v4
75+
- uses: actions/upload-artifact@v5
7676
with:
7777
name: java-artifacts
7878
path: |
@@ -112,7 +112,7 @@ jobs:
112112
cache: maven
113113

114114
# Get the build output from the unit test job
115-
- uses: actions/download-artifact@v5
115+
- uses: actions/download-artifact@v6
116116
with:
117117
name: java-artifacts
118118
- run: |
@@ -124,7 +124,7 @@ jobs:
124124

125125
# Wrap up and send to coverage job
126126
- run: tar -cvf java-reportdir.tar target/site
127-
- uses: actions/upload-artifact@v4
127+
- uses: actions/upload-artifact@v5
128128
with:
129129
name: java-reportdir
130130
path: java-reportdir.tar
@@ -145,7 +145,7 @@ jobs:
145145
cache: maven
146146

147147
# Get the build output from the integration test job
148-
- uses: actions/download-artifact@v5
148+
- uses: actions/download-artifact@v6
149149
with:
150150
name: java-reportdir
151151
- run: tar -xvf java-reportdir.tar
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Role Assignment History Tracking
2+
3+
Dataverse can now track the history of role assignments, allowing administrators to see who assigned or revoked roles, when these actions occurred, and which roles were involved. This feature helps with auditing and understanding permission changes over time.
4+
5+
## Key components of this feature:
6+
7+
- **Feature Flag**: The functionality can be enabled/disabled via the `ROLE_ASSIGNMENT_HISTORY` feature flag (default is `off`)
8+
- **UI Integration**: New history panels on permission management pages showing the complete history of role assignments/revocations
9+
- **CSV Export**: Administrators can download the role assignment history for a given collection or dataset (or files in a dataset) as a CSV file directly from the new panels
10+
- **API Access**: New API endpoints provide access to role assignment history in both JSON and CSV formats:
11+
- `/api/dataverses/{identifier}/assignments/history`
12+
- `/api/datasets/{identifier}/assignments/history`
13+
- `/api/datasets/{identifier}/files/assignments/history`
14+
15+
All return JSON by default but will return an internationalized CSV if an `Accept: text/csv` header is adde
16+
17+
For more information, see #11612
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## New Endpoint: `/datasets/{id}/license`
2+
3+
A new endpoint has been implemented to manage dataset licenses.
4+
5+
### Functionality
6+
- Updates the license of a dataset by applying it to the draft version.
7+
- If no draft exists, a new one is automatically created.
8+
9+
### Usage
10+
This endpoint supports two ways of defining a license:
11+
1. **Predefined License** – Provide the license name (e.g., `CC BY 4.0`).
12+
2. **Custom Terms of Use and Access** – Provide a JSON body with the `customTerms` object.
13+
- All fields are optional **except** `termsOfUse`, which is required.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Suppression of the Host Dataverse field
2+
3+
When creating a dataset, the _host dataverse_ field is not shown when the user can only add datasets to one collection.

doc/sphinx-guides/source/admin/integrations.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,6 @@ Discoverability
240240

241241
A number of builtin features related to data discovery are listed under :doc:`discoverability` but you can further increase the discoverability of your data by setting up integrations.
242242

243-
SHARE
244-
+++++
245-
246-
`SHARE <http://www.share-research.org>`_ is building a free, open, data set about research and scholarly activities across their life cycle. It's possible to add a Dataverse installation as one of the `sources <https://share.osf.io/sources>`_ they include if you contact the SHARE team.
247-
248243
Geodisy
249244
+++++++
250245

doc/sphinx-guides/source/api/native-api.rst

Lines changed: 252 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,6 +1485,78 @@ The fully expanded example above (without environment variables) looks like this
14851485
14861486
curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X POST "https://demo.dataverse.org/api/dataverses/1/templates" --upload-file dataverse-template.json
14871487
1488+
1489+
Dataverse Role Assignment History
1490+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1491+
1492+
Get the history of role assignments for a collection. This API call returns a list of role assignments and revocations for the specified dataset.
1493+
1494+
.. code-block:: bash
1495+
1496+
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
1497+
export SERVER_URL=https://demo.dataverse.org
1498+
export ID=1
1499+
1500+
curl -H "X-Dataverse-key:$API_TOKEN" -H "Accept: application/json" "$SERVER_URL/api/dataverses/$ID/assignments/history"
1501+
1502+
The fully expanded example above (without environment variables) looks like this:
1503+
1504+
.. code-block:: bash
1505+
1506+
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "Accept: application/json" "https://demo.dataverse.org/api/dataverses/3/assignments/history"
1507+
1508+
You can also use the collection alias instead of the numeric id:
1509+
1510+
.. code-block:: bash
1511+
1512+
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
1513+
export SERVER_URL=https://demo.dataverse.org
1514+
export DV_ALIAS=dvAlias
1515+
1516+
curl -H "X-Dataverse-key:$API_TOKEN" -H "Accept: application/json" "$SERVER_URL/api/dataverses/$DV_ALIAS/assignments/history"
1517+
1518+
The fully expanded example above (without environment variables) looks like this:
1519+
1520+
.. code-block:: bash
1521+
1522+
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "Accept: application/json" "https://demo.dataverse.org/api/datasets/dvAlias/assignments/history"
1523+
1524+
The response is a JSON array of role assignment history entries with the following structure for each entry:
1525+
1526+
.. code-block:: json
1527+
1528+
{
1529+
"definedOn": "1",
1530+
"assigneeIdentifier": "@user1",
1531+
"roleName": "Admin",
1532+
"assignedBy": "@dataverseAdmin",
1533+
"assignedAt": "2023-01-01T12:00:00Z",
1534+
"revokedBy": null,
1535+
"revokedAt": null
1536+
}
1537+
1538+
For revoked assignments, the "revokedBy" and "revokedAt" fields will contain values instead of null.
1539+
1540+
To retrieve the history in CSV format, change the Accept header to "text/csv":
1541+
1542+
.. code-block:: bash
1543+
1544+
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
1545+
export SERVER_URL=https://demo.dataverse.org
1546+
export ID=3
1547+
1548+
curl -H "X-Dataverse-key:$API_TOKEN" -H "Accept: text/csv" "$SERVER_URL/api/dataverses/$ID/assignments/history"
1549+
1550+
The fully expanded example above (without environment variables) looks like this:
1551+
1552+
.. code-block:: bash
1553+
1554+
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "Accept: text/csv" "https://demo.dataverse.org/api/dataverses/3/assignments/history"
1555+
1556+
The CSV response has column headers mirroring the JSON entries. They are internationalized (when internationalization is configured).
1557+
1558+
Note: This feature requires the "role-assignment-history" feature flag to be enabled (see :ref:`feature-flags`).
1559+
14881560
Datasets
14891561
--------
14901562

@@ -4136,25 +4208,201 @@ Delete files from a dataset. This API call allows you to delete multiple files f
41364208
41374209
curl -H "X-Dataverse-key:$API_TOKEN" -X PUT "$SERVER_URL/api/datasets/:persistentId/deleteFiles?persistentId=$PERSISTENT_IDENTIFIER" \
41384210
-H "Content-Type: application/json" \
4139-
-d '{"fileIds": [1, 2, 3]}'
4211+
-d '[1, 2, 3]'
41404212
41414213
The fully expanded example above (without environment variables) looks like this:
41424214
41434215
.. code-block:: bash
41444216
41454217
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X PUT "https://demo.dataverse.org/api/datasets/:persistentId/deleteFiles?persistentId=doi:10.5072/FK2ABCDEF" \
41464218
-H "Content-Type: application/json" \
4147-
-d '{"fileIds": [1, 2, 3]}'
4219+
-d '[1, 2, 3]'
41484220
4149-
The ``fileIds`` in the JSON payload should be an array of file IDs that you want to delete from the dataset.
4221+
The JSON payload should be an array of file IDs that you want to delete from the dataset.
41504222
41514223
You must have the appropriate permissions to delete files from the dataset.
41524224
41534225
Upon success, the API will return a JSON response with a success message and the number of files deleted.
41544226
41554227
The API call will report a 400 (BAD REQUEST) error if any of the files specified do not exist or are not in the latest version of the specified dataset.
4156-
The ``fileIds`` in the JSON payload should be an array of file IDs that you want to delete from the dataset.
4228+
The JSON payload should be an array of file IDs that you want to delete from the dataset.
4229+
4230+
.. _api-dataset-role-assignment-history:
4231+
4232+
Dataset Role Assignment History
4233+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4234+
4235+
Get the history of role assignments for a dataset. This API call returns a list of role assignments and revocations for the specified dataset.
4236+
4237+
.. code-block:: bash
4238+
4239+
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
4240+
export SERVER_URL=https://demo.dataverse.org
4241+
export ID=3
4242+
4243+
curl -H "X-Dataverse-key:$API_TOKEN" -H "Accept: application/json" "$SERVER_URL/api/datasets/$ID/assignments/history"
4244+
4245+
The fully expanded example above (without environment variables) looks like this:
4246+
4247+
.. code-block:: bash
4248+
4249+
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "Accept: application/json" "https://demo.dataverse.org/api/datasets/3/assignments/history"
4250+
4251+
You can also use the persistent identifier instead of the numeric id:
4252+
4253+
.. code-block:: bash
4254+
4255+
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
4256+
export SERVER_URL=https://demo.dataverse.org
4257+
export PERSISTENT_IDENTIFIER=doi:10.5072/FK2/ABCDEF
4258+
4259+
curl -H "X-Dataverse-key:$API_TOKEN" -H "Accept: application/json" "$SERVER_URL/api/datasets/:persistentId/assignments/history?persistentId=$PERSISTENT_IDENTIFIER"
4260+
4261+
The fully expanded example above (without environment variables) looks like this:
4262+
4263+
.. code-block:: bash
4264+
4265+
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "Accept: application/json" "https://demo.dataverse.org/api/datasets/:persistentId/assignments/history?persistentId=doi:10.5072/FK2/ABCDEF"
4266+
4267+
The response is a JSON array of role assignment history entries with the following structure for each entry:
4268+
4269+
.. code-block:: json
4270+
4271+
{
4272+
"definedOn": "3",
4273+
"assigneeIdentifier": "@user1",
4274+
"roleName": "Admin",
4275+
"assignedBy": "@dataverseAdmin",
4276+
"assignedAt": "2023-01-01T12:00:00Z",
4277+
"revokedBy": null,
4278+
"revokedAt": null
4279+
}
4280+
4281+
For revoked assignments, the "revokedBy" and "revokedAt" fields will contain values instead of null.
4282+
4283+
To retrieve the history in CSV format, change the Accept header to "text/csv":
4284+
4285+
.. code-block:: bash
4286+
4287+
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
4288+
export SERVER_URL=https://demo.dataverse.org
4289+
export ID=3
4290+
4291+
curl -H "X-Dataverse-key:$API_TOKEN" -H "Accept: text/csv" "$SERVER_URL/api/datasets/$ID/assignments/history"
4292+
4293+
The fully expanded example above (without environment variables) looks like this:
4294+
4295+
.. code-block:: bash
4296+
4297+
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "Accept: text/csv" "https://demo.dataverse.org/api/datasets/3/assignments/history"
4298+
4299+
The CSV response has column headers mirroring the JSON entries. They are internationalized (when internationalization is configured).
4300+
4301+
Note: This feature requires the "role-assignment-history" feature flag to be enabled (see :ref:`feature-flags`).
4302+
4303+
Dataset Files Role Assignment History
4304+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4305+
4306+
Get the history of role assignments for the files in a dataset. This API call returns a list of role assignments and revocations for all files in the specified dataset.
4307+
4308+
.. code-block:: bash
4309+
4310+
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
4311+
export SERVER_URL=https://demo.dataverse.org
4312+
export ID=3
4313+
4314+
curl -H "X-Dataverse-key:$API_TOKEN" -H "Accept: application/json" "$SERVER_URL/api/datasets/$ID/files/assignments/history"
4315+
4316+
The fully expanded example above (without environment variables) looks like this:
4317+
4318+
.. code-block:: bash
4319+
4320+
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "Accept: application/json" "https://demo.dataverse.org/api/datasets/3/files/assignments/history"
4321+
4322+
You can also use the persistent identifier instead of the numeric id:
4323+
4324+
.. code-block:: bash
4325+
4326+
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
4327+
export SERVER_URL=https://demo.dataverse.org
4328+
export PERSISTENT_IDENTIFIER=doi:10.5072/FK2/ABCDEF
4329+
4330+
curl -H "X-Dataverse-key:$API_TOKEN" -H "Accept: application/json" "$SERVER_URL/api/datasets/:persistentId/files/assignments/history?persistentId=$PERSISTENT_IDENTIFIER"
4331+
4332+
The fully expanded example above (without environment variables) looks like this:
4333+
4334+
.. code-block:: bash
4335+
4336+
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "Accept: application/json" "https://demo.dataverse.org/api/datasets/:persistentId/files/assignments/history?persistentId=doi:10.5072/FK2/ABCDEF"
4337+
4338+
The JSON response for this call is the same as for the /api/datasets/{id}/assignments/history call above with the exception that definedOn will be a comma separated list of one or more file ids.
4339+
4340+
To retrieve the history in CSV format, change the Accept header to "text/csv":
4341+
4342+
.. code-block:: bash
4343+
4344+
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
4345+
export SERVER_URL=https://demo.dataverse.org
4346+
export ID=3
4347+
4348+
curl -H "X-Dataverse-key:$API_TOKEN" -H "Accept: text/csv" "$SERVER_URL/api/datasets/files/$ID/assignments/history"
4349+
4350+
The fully expanded example above (without environment variables) looks like this:
4351+
4352+
.. code-block:: bash
4353+
4354+
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "Accept: text/csv" "https://demo.dataverse.org/api/datasets/3/files/assignments/history"
4355+
4356+
The CSV response for this call is the same as for the /api/datasets/{id}/assignments/history call above with the exception that definedOn will be a comma separated list of one or more file ids.
4357+
4358+
Note: This feature requires the "role-assignment-history" feature flag to be enabled (see :ref:`feature-flags`).
4359+
4360+
Update Dataset License
4361+
~~~~~~~~~~~~~~~~~~~~~~
4362+
4363+
Updates the license of a dataset by applying it to the draft version, or by creating a draft if none exists.
4364+
4365+
The JSON representation of a license can take two forms, depending on whether you want to specify a predefined license or define custom terms of use and access.
4366+
4367+
To set a predefined license (e.g., CC BY 4.0), provide a JSON body with the license name:
4368+
4369+
.. code-block:: json
4370+
4371+
{
4372+
"name": "CC BY 4.0"
4373+
}
4374+
4375+
To define custom terms of use and access, provide a JSON body with the following properties. All fields within ``customTerms`` are optional, except for the ``termsOfUse`` field, which is required:
4376+
4377+
.. code-block:: json
4378+
4379+
{
4380+
"customTerms": {
4381+
"termsOfUse": "Your terms of use",
4382+
"confidentialityDeclaration": "Your confidentiality declaration",
4383+
"specialPermissions": "Your special permissions",
4384+
"restrictions": "Your restrictions",
4385+
"citationRequirements": "Your citation requirements",
4386+
"depositorRequirements": "Your depositor requirements",
4387+
"conditions": "Your conditions",
4388+
"disclaimer": "Your disclaimer"
4389+
}
4390+
}
4391+
4392+
.. code-block:: bash
4393+
4394+
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
4395+
export SERVER_URL=https://demo.dataverse.org
4396+
export ID=3
4397+
export FILE_PATH=license.json
4398+
4399+
curl -H "X-Dataverse-key:$API_TOKEN" -X PUT "$SERVER_URL/api/datasets/$ID/license" -H "Content-type:application/json" --upload-file $FILE_PATH
4400+
4401+
The fully expanded example above (without environment variables) looks like this:
4402+
4403+
.. code-block:: bash
41574404
4405+
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X PUT "https://demo.dataverse.org/api/datasets/3/license" -H "Content-type:application/json" --upload-file license.json
41584406
41594407
Files
41604408
-----

0 commit comments

Comments
 (0)