Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove references to unsupported access condition operations for WSI upload #266

Merged
merged 1 commit into from
May 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions workspaceitem-data-upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,10 @@ The replace operation allows to replace *existent* information with new one. Att
Similarly to what has been described for the add operation you can look to the documentation about [the submission-form sectionType](workspaceitem-data-metadata.md) for example about how to replace a metadata or a single metadata value for the file. You will only need to use the *path* to the file'metadata as specified above, i.e. adding /files/<:idx-file>/metadata/

#### Access Condition
You can replace an existent access condition with a new one or update some settings of an existent access condition using the replace operation. The new settings must be valid for the selected access condition (name) according to the [submissionupload configuration endpoint](submissionuploads.md).
You can replace an existent access condition with a new one using the replace operation. The new settings must be valid for the selected access condition (name) according to the [submissionupload configuration endpoint](submissionuploads.md).

To replace an access condition with a new one
`curl --data '{[ { "op": "add", "path": "/sections/<:name-of-the-form>/files/<:file-idx>/accessConditions/0", "value": {name: "embargo", startDate: "2018-12-31"}}]}' -X PATCH ${dspace7-url}/api/submission/workspaceitems/<:id>`

to update the embargo start date
`curl --data '{[ { "op": "add", "path": "/sections/<:name-of-the-form>/files/<:file-idx>/accessConditions/0/startDate", "value": "2019-12-31"}]}' -X PATCH ${dspace7-url}/api/submission/workspaceitems/<:id>`

to transform an existent *openaccess* access condition to an *administrator* access condition
`curl --data '{[ { "op": "add", "path": "/sections/<:name-of-the-form>/files/<:file-idx>/accessConditions/0/name", "value": "administrator"}]}' -X PATCH ${dspace7-url}/api/submission/workspaceitems/<:id>`

please note that the above works only because of openaccess and administrator have the same settings needs (no need of addition information). Indeed, the backend is expected to remove the existent policy and create a new policy. If the settings of the previous and new access condition differs the request must fail with a 422 error code

### Move
Expand Down