Dataverse collection linking/unlinking without superuser status#12250
Dataverse collection linking/unlinking without superuser status#12250vera wants to merge 12 commits into
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 |
|
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 |
|
@sekmiller I have updated the dataverse page to show only collections for which the user has the I've also updated Screenshots: When there are multiple eligible Dataverse collections to link to:
When there is only one:
Also works for linking a search:
When there are no remaining eligible Dataverse collections to link to (I've already linked this collection to every one of them):
|
|
@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 |
|
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. |
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. |




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