feat: add API for getting default contributor role of a collection#12112
feat: add API for getting default contributor role of a collection#12112pdurbin merged 6 commits intoIQSS:developfrom
Conversation
a1dc84e to
df216cb
Compare
pdurbin
left a comment
There was a problem hiding this comment.
Tests are passing: https://jenkins.dataverse.org/job/IQSS-Dataverse-Develop-PR/job/PR-12112/5/testReport/
Docs look good: https://dataverse-guide--12112.org.readthedocs.build/en/12112/api/native-api.html#get-default-role-assigned-to-user-creating-a-dataset-in-a-dataverse-collection (see just above for the older, related endpoint)
I ran mvn test -Dtest=DataversesIT#testUpdateDefaultContributorRole manually locally and it worked fine. Here's some sample output:
{
"status": "OK",
"data": {
"alias": "curator",
"name": "Curator",
"permissions": [
"AddDataverse",
"AddDataset",
"ViewUnpublishedDataverse",
"ViewUnpublishedDataset",
"DownloadFile",
"EditDataset",
"ManageDatasetPermissions",
"ManageFilePermissions",
"PublishDataset",
"LinkDataset",
"DeleteDatasetDraft"
],
"description": "For datasets, a person who can edit License + Terms, edit Permissions, and publish and link datasets.",
"id": 7
}
}
It's a little weird it that is says @author landreev when it's really @vera. 😄 I'll remove it.
I question a bit why any permissions are required for this endpoint but we can always loosen it up from ManageDataversePermissions to nothing later if people want. Actually, the docs don't explain the required permissions. They should. I'll add something to the docs for the new endpoint and the old one it's inspired by.
Added for the older endpoint too.
Oops, thanks for the cleanup 😄 |
What this PR does / why we need it:
This PR adds a new API endpoint for getting the default contributor role for a collection (
GET /api/dataverses/$ID/defaultContributorRole), analogous to the existing endpoint for setting it (PUT /api/dataverses/$ID/defaultContributorRole/$ALIAS), added in this PR:Which issue(s) this PR closes:
Special notes for your reviewer:
/
Suggestions on how to test this:
I've extended the existing test:
mvn test -Dtest="DataversesIT#testUpdateDefaultContributorRole"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?:
I will add a short release note.
Additional documentation:
Preview docs at https://dataverse-guide--12112.org.readthedocs.build/en/12112/api/native-api.html#get-default-role-assigned-to-user-creating-a-dataset-in-a-dataverse-collection