Skip to content

Commit 07a9647

Browse files
authored
Merge pull request #11682 from IQSS/revert-11534-feat/link-permission
Revert "feat: "Link Dataset/Dataverse" permission"
2 parents a61ec40 + a4ea861 commit 07a9647

File tree

12 files changed

+27
-45
lines changed

12 files changed

+27
-45
lines changed

doc/release-notes/11534-link-permissions.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

doc/sphinx-guides/source/admin/dataverses-datasets.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Moves a dataset whose id is passed to a Dataverse collection whose alias is pass
118118
Link a Dataset
119119
^^^^^^^^^^^^^^
120120

121-
Creates a link between a dataset and a Dataverse collection (see the :ref:`dataset-linking` section of the User Guide for more information). Accessible to users with Link Dataset permission on the Dataverse collection. ::
121+
Creates a link between a dataset and a Dataverse collection (see the :ref:`dataset-linking` section of the User Guide for more information). ::
122122

123123
curl -H "X-Dataverse-key: $API_TOKEN" -X PUT http://$SERVER/api/datasets/$linked-dataset-id/link/$linking-dataverse-alias
124124

@@ -155,7 +155,7 @@ It returns a list in the following format (new format as of v6.4):
155155
Unlink a Dataset
156156
^^^^^^^^^^^^^^^^
157157

158-
Removes a link between a dataset and a Dataverse collection. Accessible to users with Link Dataset permission on the Dataverse collection. ::
158+
Removes a link between a dataset and a Dataverse collection. Accessible to users with Publish Dataset permissions. ::
159159

160160
curl -H "X-Dataverse-key: $API_TOKEN" -X DELETE http://$SERVER/api/datasets/$linked-dataset-id/deleteLink/$linking-dataverse-alias
161161

doc/sphinx-guides/source/user/dataverse-management.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ Dataset linking allows a Dataverse collection owner to "link" their Dataverse co
215215

216216
For example, researchers working on a collaborative study across institutions can each link their own individual institutional Dataverse collections to the one collaborative dataset, making it easier for interested parties from each institution to find the study.
217217

218-
In order to link a dataset, you will need your account to have the "Link Dataset" permission on the Dataverse collection that is doing the linking. If you created the Dataverse collection then you should have this permission already, but if not then you will need to ask the admin of that Dataverse collection to assign that permission to your account. You do not need any special permissions on the dataset being linked.
218+
In order to link a dataset, you will need your account to have the "Publish Dataset" permission on the Dataverse collection that is doing the linking. If you created the Dataverse collection then you should have this permission already, but if not then you will need to ask the admin of that Dataverse collection to assign that permission to your account. You do not need any special permissions on the dataset being linked.
219219

220220
To link a dataset to your Dataverse collection, you must navigate to that dataset and click the white "Link" button in the upper-right corner of the dataset page. This will open up a window where you can type in the name of the Dataverse collection that you would like to link the dataset to. Select your Dataverse collection and click the save button. This will establish the link, and the dataset will now appear under your Dataverse collection.
221221

scripts/api/data/role-curator.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{
22
"alias":"curator",
33
"name":"Curator",
4-
"description":"For datasets, a person who can edit License + Terms, edit Permissions, and publish and link datasets.",
4+
"description":"For datasets, a person who can edit License + Terms, edit Permissions, and publish datasets.",
55
"permissions":[
66
"ViewUnpublishedDataset",
77
"EditDataset",
88
"DownloadFile",
99
"DeleteDatasetDraft",
1010
"PublishDataset",
11-
"LinkDataset",
1211
"ManageDatasetPermissions",
1312
"ManageFilePermissions",
1413
"AddDataverse",

src/main/java/edu/harvard/iq/dataverse/DataverseServiceBean.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ public List<Dataverse> filterDataversesForLinking(String query, DataverseRequest
512512

513513
for (Dataverse res : results) {
514514
if (!remove.contains(res)) {
515-
if (this.permissionService.requestOn(req, res).has(Permission.LinkDataset)) {
515+
if (this.permissionService.requestOn(req, res).has(Permission.PublishDataset)) {
516516
dataverseList.add(res);
517517
}
518518
}
@@ -525,7 +525,7 @@ public List<Dataverse> filterDataversesForUnLinking(String query, DataverseReque
525525
List<Dataverse> dataverseList = new ArrayList<>();
526526
if (alreadyLinkeddv_ids != null && !alreadyLinkeddv_ids.isEmpty()) {
527527
alreadyLinkeddv_ids.stream().map((testDVId) -> this.find(testDVId)).forEachOrdered((dataverse) -> {
528-
if (this.permissionService.requestOn(req, dataverse).has(Permission.LinkDataset)) {
528+
if (this.permissionService.requestOn(req, dataverse).has(Permission.PublishDataset)) {
529529
dataverseList.add(dataverse);
530530
}
531531
});

src/main/java/edu/harvard/iq/dataverse/authorization/Permission.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ public enum Permission implements java.io.Serializable {
4848
ManageDatasetPermissions(BundleUtil.getStringFromBundle("permission.managePermissionsDataset"), true, Dataset.class),
4949
ManageFilePermissions(BundleUtil.getStringFromBundle("permission.managePermissionsDataFile"), true, DataFile.class),
5050
PublishDataverse(BundleUtil.getStringFromBundle("permission.publishDataverse"), true, Dataverse.class),
51-
LinkDataverse(BundleUtil.getStringFromBundle("permission.linkDataverse"), true, Dataverse.class),
5251
PublishDataset(BundleUtil.getStringFromBundle("permission.publishDataset"), true, Dataset.class, Dataverse.class),
53-
LinkDataset(BundleUtil.getStringFromBundle("permission.linkDataset"), true, Dataset.class, Dataverse.class),
5452
// Delete
5553
DeleteDataverse(BundleUtil.getStringFromBundle("permission.deleteDataverse"), true, Dataverse.class),
5654
DeleteDatasetDraft(BundleUtil.getStringFromBundle("permission.deleteDataset"), true, Dataset.class);

src/main/java/edu/harvard/iq/dataverse/engine/command/impl/DeleteDatasetLinkingDataverseCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
* @author sarahferry
2424
*/
2525

26-
@RequiredPermissions( Permission.LinkDataset )
26+
@RequiredPermissions( Permission.PublishDataset )
2727
public class DeleteDatasetLinkingDataverseCommand extends AbstractCommand<Dataset>{
2828
private final DatasetLinkingDataverse doomed;
2929
private final Dataset editedDs;
3030
private final boolean index;
3131

3232
public DeleteDatasetLinkingDataverseCommand(DataverseRequest aRequest, Dataset editedDs , DatasetLinkingDataverse doomed, boolean index) {
33-
super(aRequest, doomed.getLinkingDataverse());
33+
super(aRequest, editedDs);
3434
this.editedDs = editedDs;
3535
this.doomed = doomed;
3636
this.index = index;

src/main/java/edu/harvard/iq/dataverse/engine/command/impl/LinkDatasetCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
* @author skraffmiller
2828
*/
29-
@RequiredPermissions(Permission.LinkDataset)
29+
@RequiredPermissions(Permission.PublishDataset)
3030
public class LinkDatasetCommand extends AbstractCommand<DatasetLinkingDataverse> {
3131

3232
private final Dataset linkedDataset;

src/main/java/edu/harvard/iq/dataverse/engine/command/impl/LinkDataverseCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*
3232
* @author skraffmiller
3333
*/
34-
@RequiredPermissions(Permission.LinkDataverse)
34+
@RequiredPermissions(Permission.PublishDataverse)
3535
public class LinkDataverseCommand extends AbstractCommand<DataverseLinkingDataverse> {
3636

3737
private final Dataverse linkedDataverse;
@@ -47,7 +47,7 @@ public LinkDataverseCommand(DataverseRequest aRequest, Dataverse dataverse, Data
4747
public DataverseLinkingDataverse execute(CommandContext ctxt) throws CommandException {
4848
if ((!(getUser() instanceof AuthenticatedUser) || !getUser().isSuperuser())) {
4949
throw new PermissionException("Link Dataverse can only be called by superusers.",
50-
this, Collections.singleton(Permission.LinkDataverse), linkingDataverse);
50+
this, Collections.singleton(Permission.PublishDataverse), linkingDataverse);
5151
}
5252
if (linkedDataverse.equals(linkingDataverse)) {
5353
throw new IllegalCommandException("Can't link a dataverse to itself", this);

src/main/java/propertyFiles/BuiltInRoles.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ role.admin.description=A person who has all permissions for dataverses, datasets
33
role.contributor.name=Contributor
44
role.contributor.description=For datasets, a person who can edit License + Terms, and then submit them for review.
55
role.curator.name=Curator
6-
role.curator.description=For datasets, a person who can edit License + Terms, edit Permissions, and publish and link datasets.
6+
role.curator.description=For datasets, a person who can edit License + Terms, edit Permissions, and publish datasets.
77
role.dscontributor.name=Dataset Creator
88
role.dscontributor.description=A person who can add datasets within a dataverse.
99
role.fullcontributor.name=Dataverse + Dataset Creator

0 commit comments

Comments
 (0)