Skip to content

feat: let APIs return more info about role assignments#11920

Open
vera wants to merge 5 commits intoIQSS:developfrom
vera:feat/list-assignments-more-info
Open

feat: let APIs return more info about role assignments#11920
vera wants to merge 5 commits intoIQSS:developfrom
vera:feat/list-assignments-more-info

Conversation

@vera
Copy link
Contributor

@vera vera commented Oct 22, 2025

What this PR does / why we need it:

This PR updates all API endpoints that return information about role assignments (such as /api/dataverses/$ID/assignments and /api/datasets/$ID/assignments) to include additional fields in their JSON responses: assigneeName, roleDescription, definitionPointName, definitionPointType, and definitionPointGlobalId (if available).

We use this in our custom UI to display the list of assigned roles, similar to this Dataverse UI page:

image

The extended API responses should also be helpful for the SPA.

Which issue(s) this PR closes:

Not aware of any issue

Special notes for your reviewer:

/

Suggestions on how to test this:

Use API that returns information about role assignments, e.g. curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" "localhost:8080/api/dataverses/root/assignments", and see the extended JSON response.

Example response for a dataset (corresponds to UI screenshot above):

{
    "status":"OK",
    "data":[
        {
            "id":32067,
            "assigneeId":"@testuser",
            "assigneeName":"Test User",
            "roleId":6,
            "roleName":"Contributor",
            "roleDescription":"For datasets, a person who can edit License + Terms, and then submit them for review.",
            "_roleAlias":"contributor",
            "definitionPointId":48080,
            "definitionPointName":"Test title",
            "definitionPointType":"Dataset",
            "definitionPointGlobalId":"perma:testpid-30378"
        },
        {
            "id":2,
            "assigneeId":"@dataverseAdmin",
            "assigneeName":"Dataverse Admin",
            "roleId":1,
            "roleName":"Admin",
            "roleDescription":"A person who has all permissions for dataverses, datasets, and files, including approving requests for restricted data.",
            "_roleAlias":"admin",
            "definitionPointId":2,
            "definitionPointName":"NFDI4Health",
            "definitionPointType":"Dataverse"
        },
        {
            "id":4,
            "assigneeId":":authenticated-users",
            "assigneeName":"Anyone with a Dataverse account",
            "roleId":5,
            "roleName":"Dataset Creator",
            "roleDescription":"A person who can add datasets within a dataverse.",
            "_roleAlias":"dsContributor",
            "definitionPointId":2,
            "definitionPointName":"NFDI4Health",
            "definitionPointType":"Dataverse"
        },
        {
            "id":1679,
            "assigneeId":"&explicit/2-curators",
            "assigneeName":"Curators",
            "roleId":7,
            "roleName":"Curator",
            "roleDescription":"For datasets, a person who can edit License + Terms, edit Permissions, and publish and link datasets.",
            "_roleAlias":"curator",
            "definitionPointId":2,
            "definitionPointName":"NFDI4Health",
            "definitionPointType":"Dataverse"
        }
    ]
}

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've included a release note

Additional documentation:

/

cc @johannes-darms

@coveralls
Copy link

coveralls commented Oct 22, 2025

Coverage Status

coverage: 23.515% (+0.009%) from 23.506%
when pulling ae5a7ab on vera:feat/list-assignments-more-info
into a696b36 on IQSS:develop.

@pdurbin pdurbin moved this to Ready for Triage in IQSS Dataverse Project Oct 28, 2025
@ofahimIQSS ofahimIQSS moved this from Ready for Triage to Ready for Review ⏩ in IQSS Dataverse Project Oct 28, 2025
@ofahimIQSS ofahimIQSS added the Size: 3 A percentage of a sprint. 2.1 hours. label Oct 28, 2025
@stevenwinship
Copy link
Contributor

@vera Please address the conflicts

@stevenwinship stevenwinship moved this from Ready for Review ⏩ to In Progress 💻 in IQSS Dataverse Project Nov 4, 2025
# Conflicts:
#	src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java
@vera
Copy link
Contributor Author

vera commented Nov 5, 2025

@vera Please address the conflicts

Done!

@cmbz cmbz added FY26 Sprint 9 FY26 Sprint 9 (2025-10-22 - 2025-11-05) FY26 Sprint 10 FY26 Sprint 10 (2025-11-05 - 2025-11-19) labels Nov 5, 2025
@cmbz cmbz added the FY26 Sprint 11 FY26 Sprint 11 (2025-11-20 - 2025-12-03) label Nov 22, 2025
@cmbz cmbz added the FY26 Sprint 12 FY26 Sprint 12 (2025-12-03 - 2025-12-17) label Dec 3, 2025
vera added a commit to nfdi4health/dataverse that referenced this pull request Dec 12, 2025
@cmbz cmbz added the FY26 Sprint 13 FY26 Sprint 13 (2025-12-17 - 2025-12-31) label Dec 17, 2025
@cmbz cmbz added the FY26 Sprint 14 FY26 Sprint 14 (2025-12-31 - 2026-01-14) label Dec 31, 2025
@cmbz cmbz added the FY26 Sprint 15 FY26 Sprint 15 (2026-01-14 - 2026-01-28) label Jan 15, 2026
vera added a commit to nfdi4health/dataverse that referenced this pull request Jan 29, 2026
@cmbz cmbz added the FY26 Sprint 16 FY26 Sprint 16 (2026-01-28 - 2026-02-11) label Jan 29, 2026
@cmbz cmbz added the FY26 Sprint 17 FY26 Sprint 17 (2026-02-11 - 2026-02-25) label Feb 11, 2026
@cmbz cmbz moved this from In Progress 💻 to SPRINT READY in IQSS Dataverse Project Feb 25, 2026
@cmbz cmbz moved this from SPRINT READY to Ready for Review ⏩ in IQSS Dataverse Project Feb 25, 2026
@cmbz cmbz added the FY26 Sprint 18 FY26 Sprint 18 (2026-02-25 - 2026-03-11) label Feb 26, 2026
@stevenwinship stevenwinship moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Mar 10, 2026
@stevenwinship stevenwinship self-assigned this Mar 10, 2026
@github-project-automation github-project-automation bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Mar 10, 2026
@stevenwinship stevenwinship removed their assignment Mar 10, 2026
@cmbz cmbz added this to the 6.11 milestone Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 9 FY26 Sprint 9 (2025-10-22 - 2025-11-05) FY26 Sprint 10 FY26 Sprint 10 (2025-11-05 - 2025-11-19) FY26 Sprint 11 FY26 Sprint 11 (2025-11-20 - 2025-12-03) FY26 Sprint 12 FY26 Sprint 12 (2025-12-03 - 2025-12-17) FY26 Sprint 13 FY26 Sprint 13 (2025-12-17 - 2025-12-31) FY26 Sprint 14 FY26 Sprint 14 (2025-12-31 - 2026-01-14) FY26 Sprint 15 FY26 Sprint 15 (2026-01-14 - 2026-01-28) FY26 Sprint 16 FY26 Sprint 16 (2026-01-28 - 2026-02-11) FY26 Sprint 17 FY26 Sprint 17 (2026-02-11 - 2026-02-25) FY26 Sprint 18 FY26 Sprint 18 (2026-02-25 - 2026-03-11) Size: 3 A percentage of a sprint. 2.1 hours.

Projects

Status: Ready for QA ⏩

Development

Successfully merging this pull request may close these issues.

5 participants