Skip to content

Create PublishedData with public Datasets #2378

@fpotier

Description

@fpotier

Summary

The UI lets you select Datasets you don't own (Public Data) when creating a PublishedData but trying to publish it will actually fail because it tries to set isPublished to true but the user doesn't have permissions for updating this kind of dataset

Steps to Reproduce

Select a public dataset when creating a PublishedData, fill in all required metadata, and try to publish it from the UI.

Current Behaviour

Fails with 403

Expected Behaviour

Option 1: disallow selection of datasets for which you don't have write access (update) in the UI

Option 2: don't fail/update if the dataset is already public

relevant code:

// Make datasets in publishedData datasetPids array public
const datasetPids = publishedData.datasetPids;
await Promise.all(
datasetPids.map(async (pid) => {
await this.datasetsController.findByIdAndUpdate(request, pid, {
isPublished: true,
});
}),
);

Details

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions