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:
https://github.com/SciCatProject/scicat-backend-next/blob/583924143bb309ee586c220bf66718a8b413318b/src/published-data/published-data.v4.controller.ts#L421-L429
Details
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
isPublishedto true but the user doesn't have permissions for updating this kind of datasetSteps 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:
https://github.com/SciCatProject/scicat-backend-next/blob/583924143bb309ee586c220bf66718a8b413318b/src/published-data/published-data.v4.controller.ts#L421-L429
Details