Skip to content

Dataverse collection linking/unlinking without superuser status#12250

Open
vera wants to merge 12 commits into
IQSS:developfrom
vera:feat/non-superuser-dataverse-linking
Open

Dataverse collection linking/unlinking without superuser status#12250
vera wants to merge 12 commits into
IQSS:developfrom
vera:feat/non-superuser-dataverse-linking

Conversation

@vera
Copy link
Copy Markdown
Contributor

@vera vera commented Mar 24, 2026

What this PR does / why we need it:

Dataverse collection linking and unlinking no longer requires superuser status. Users with the "Link Dataverse" permission on a collection can now perform these actions through both the UI and API.

This change follows up on the introduction of the "Link Dataverse" permission. Previously, even with this permission, only superusers could actually perform linking actions, as reported in #12076.

  • Removed the superuser requirement for linking and unlinking Dataverse collections. (Updated the LinkDataverseCommand and DeleteDataverseLinkingDataverseCommand to use the LinkDataverse permission instead of a superuser check.)
  • Enabled the "Link" button in the Dataverse collection UI for non-superusers.
  • Updated documentation and integration tests to reflect these changes.
  • Fixed a bug in the linking service and API (discovered during testing) where the "linking" and "linked" collections were being mixed up during lookups and deletions.

Which issue(s) this PR closes:

Special notes for your reviewer:

/

Suggestions on how to test this:

I've updated the following test:

mvn test -Dtest="LinkIT#testCreateDeleteDataverseLink"

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

No

Is there a release notes update needed for this change?:

I added a release note

Additional documentation:

/

@pdurbin pdurbin moved this to Ready for Triage in IQSS Dataverse Project Mar 24, 2026
@scolapasta scolapasta moved this from Ready for Triage to Ready for Review ⏩ in IQSS Dataverse Project Mar 24, 2026
@cmbz cmbz added the FY26 Sprint 20 FY26 Sprint 20 (2026-03-26 - 2026-04-08) label Mar 27, 2026
@pdurbin pdurbin force-pushed the feat/non-superuser-dataverse-linking branch from dce93ce to 02ae1be Compare April 2, 2026 14:16
@stevenwinship stevenwinship self-assigned this Apr 2, 2026
@stevenwinship stevenwinship moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Apr 2, 2026
Comment thread doc/sphinx-guides/source/api/native-api.rst Outdated
Comment thread doc/sphinx-guides/source/api/native-api.rst Outdated
Comment thread doc/sphinx-guides/source/api/native-api.rst Outdated
@cmbz cmbz added the FY26 Sprint 21 FY26 Sprint 21 (2026-04-08 - 2026-04-22) label Apr 8, 2026
@github-project-automation github-project-automation Bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Apr 10, 2026
@cmbz cmbz added the FY26 Sprint 22 FY26 Sprint 22 (2026-04-22 - 2026-05-06) label Apr 22, 2026
@cmbz cmbz added the FY26 Sprint 23 FY26 Sprint 23 (2026-05-06 - 2026-05-20) label May 6, 2026
@sekmiller sekmiller self-assigned this May 11, 2026
@sekmiller sekmiller moved this from Ready for QA ⏩ to QA ✅ in IQSS Dataverse Project May 11, 2026
@sekmiller
Copy link
Copy Markdown
Contributor

There's a method in the Dataverse page that makes a list of Dataverses available to be linked to - updateLinkableDataverses. It is still considering all dataverses for this list since linking was a superuser only function. Now that non-superusers are allowed it should be changed to include only those Dataverses that the user has permission on. As is - if the non-super user picks a dataverse from this list that they do not have permission on the link will fail and an "internal error" is posted to the UI

@jp-tosca jp-tosca added the Status: Needs Input Applied to issues in need of input from someone currently unavailable label May 18, 2026
@sekmiller
Copy link
Copy Markdown
Contributor

Hi @vera, just wondering if you've had a chance to look at this or if you have any questions. thanks!

@vera
Copy link
Copy Markdown
Contributor Author

vera commented May 18, 2026

Hi @vera, just wondering if you've had a chance to look at this or if you have any questions. thanks!

@sekmiller Hi, yes sorry, on initial read, I must have misunderstood your comment above (wasn't sure if that was to be fixed as part of this PR). I'll take a look at updateLinkableDataverses tomorrow. 👍

@vera
Copy link
Copy Markdown
Contributor Author

vera commented May 19, 2026

@sekmiller I have updated the dataverse page to show only collections for which the user has the LinkDataverse permission. I've aligned the logic as closely as possible to the logic in GetLinkingDataverseListCommand.

I've also updated CreateSavedSearchCommand so it has the same permission requirement. (Previously, that still required "PublishDataverse" permission. I think I overlooked it in my PR where I added the "LinkDataverse" permission.)

Screenshots:

When there are multiple eligible Dataverse collections to link to:

image

When there is only one:

image

Also works for linking a search:

image

When there are no remaining eligible Dataverse collections to link to (I've already linked this collection to every one of them):

image

@DS-INRAE DS-INRAE moved this to 🔍 Interest in Recherche Data Gouv May 20, 2026
@sekmiller sekmiller removed the Status: Needs Input Applied to issues in need of input from someone currently unavailable label May 20, 2026
@sekmiller
Copy link
Copy Markdown
Contributor

@vera Sorry - just found something else. When a non-super user links a dataverse, it works but there's no success message banner. If a Super-user links a dataverse they do get a success message banner. Can you take a look? thanks!

@cmbz cmbz added the FY26 Sprint 24 FY26 Sprint 24 (2026-05-20 - 2026-06-03) label May 21, 2026
@vera
Copy link
Copy Markdown
Contributor Author

vera commented May 26, 2026

@vera Sorry - just found something else. When a non-super user links a dataverse, it works but there's no success message banner. If a Super-user links a dataverse they do get a success message banner. Can you take a look? thanks!

Should be fixed now. Unlike the "Save" button shown to users with access to multiple dataverses, the "Save" button for users with only one permitted dataverse used an actionListener instead of an action. Since actionListener apparently ignores the method’s return value, the redirect was never executed and the success message was not shown.

@sekmiller
Copy link
Copy Markdown
Contributor

I'm sorry @vera I found a couple of other things. (possibly because I'm misunderstanding the issue). I thought that if I have the ability to link to my dataverse that I should see the link button on every dataverse, except root, because I should be able to link any dataverse except for root to my dataverse(with other restrictions on linking dataverses within the same "directory tree"). If I'm a non-superuser I see the link button on every dataset, but not every dataverse (as it stands you need to have admin status on a dataverse in order to see the link button.)

Also, if I have linked a dataverse as a non-superuser I am seeing the link button on the linked dataverse, but not the unlink button.

@vera
Copy link
Copy Markdown
Contributor Author

vera commented May 28, 2026

I'm sorry @vera I found a couple of other things. (possibly because I'm misunderstanding the issue).

No problem, I think this PR is taking a few more review iterations because these UI changes are follow-ups to API changes I introduced, and since we don’t normally work in or use this UI, I’m not very familiar with the code 😄

If I'm a non-superuser I see the link button on every dataset, but not every dataverse (as it stands you need to have admin status on a dataverse in order to see the link button.)

You're right, the logic for the "Link" button showing or not was incorrect.

I've updated the logic now to show the button whenever a logged-in user has the LinkDataverse permission on any eligible collection outside the current collection's tree. As before, the Link dialog handles the case when all of those eligible collections are already linking to the current collection.

Also, if I have linked a dataverse as a non-superuser I am seeing the link button on the linked dataverse, but not the unlink button.

I think that there is no "Unlink Dataverse" button functionality existing in the UI. It's been implemented for datasets, but not collections, as far as I could see.

@cmbz cmbz added the FY26 Sprint 25 FY26 Sprint 25 (2026-06-03 - 2026-06-17) label Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 20 FY26 Sprint 20 (2026-03-26 - 2026-04-08) FY26 Sprint 21 FY26 Sprint 21 (2026-04-08 - 2026-04-22) FY26 Sprint 22 FY26 Sprint 22 (2026-04-22 - 2026-05-06) FY26 Sprint 23 FY26 Sprint 23 (2026-05-06 - 2026-05-20) FY26 Sprint 24 FY26 Sprint 24 (2026-05-20 - 2026-06-03) FY26 Sprint 25 FY26 Sprint 25 (2026-06-03 - 2026-06-17)

Projects

Status: QA ✅
Status: 🔍 Interest

Development

Successfully merging this pull request may close these issues.

Dataverse linking still requires superuser despite introduction of LinkDataverse permission

8 participants