Dataverse collection linking/unlinking without superuser status#12250
Conversation
…tions via API (no superuser)
dce93ce to
02ae1be
Compare
|
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 |
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 😄
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
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. |
|
@vera I just picked this up again after being away and focusing on other things. I'm seeing a test failure in MoveIT - testMoveLinkedDataset which seems to be related. Can you please take a look? thanks. |
|
I'm not sure I can reproduce the error: Do you have a specific error message? Thanks! |
|
@srmanda-cs this is a case where there's a failure in Jenkins (MoveIT) but not GitHub Actions. Strange. @vera a related issue: |
|
@vera here's the line number:
|
|
|
Thanks @pdurbin ! That is strange. I've run the test multiple times locally and never got a failure. Looking at the test code, I suspect it may be a timing-related issue and not necessarily related to a change in this PR. The move with |
|
could you try rebasing the branch on develop and see if that fixes it? |
Everything seems to be OK now 👍 |
|
I triggered a rebuild on Jenkins, let's see. |
|
|
Yeah, probably flaky tests. All API tests are passing in both CI systems as of this writing. |
|
Merging this PR may have caused complications with this one: @stevenwinship found two bugs in this PR (#12250), which he has fixed in the PR above. See this commit: fe2c8ad |
Conflicts with IQSS#12250: src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java




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.
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:
/