@@ -137,7 +137,14 @@ Return codes:
137137The add operation allows to initialize or replace information with new one.
138138
139139To set a startDate
140- ` curl --data '[ { "op": "add", "path": "/startDate", "value": "2019-10-31" }]' -H "Authorization: Bearer ..." -H "content-type: application/json" -X PATCH ${dspace7-url}/api/authz/resourcepolicies/${resourcepolicy-id} `
140+
141+ ```
142+ curl --data '[ { "op": "add", "path": "/startDate", "value": "2019-10-31" }]' \
143+ -H 'Authorization: Bearer ...' \
144+ -H 'content-type: application/json' \
145+ -X PATCH \
146+ '${dspace7-url}/api/authz/resourcepolicies/${resourcepolicy-id}'
147+ ```
141148
142149``` json
143150 "id" : 2844 ,
@@ -164,8 +171,14 @@ the add operation will result in:
164171```
165172
166173To set a name and a description
167- ` curl --data '[ { "op": "add", "path": "/name", "value": "my name" }, { "op": "add", "path": "/description", "value": "my description"}]' -H "Authorization: Bearer ..." -H "content-type: application/json" -X PATCH ${dspace7-url}/api/authz/resourcepolicies/${resourcepolicy-id} `
168174
175+ ```
176+ curl --data '[ { "op": "add", "path": "/name", "value": "my name" }, { "op": "add", "path": "/description", "value": "my description"}]' \
177+ -H 'Authorization: Bearer ...' \
178+ -H 'content-type: application/json' \
179+ -X PATCH \
180+ '${dspace7-url}/api/authz/resourcepolicies/${resourcepolicy-id}'
181+ ```
169182
170183``` json
171184 "id" : 2844 ,
@@ -207,7 +220,14 @@ With the `remove` operation, you can delete:
207220the other properties cannot be nullified.
208221
209222To remove an embargo you can for instance use the following
210- ` curl --data '[ { "op": "remove", "path": "/startDate" }]' -H "Authorization: Bearer ..." -H "content-type: application/json" -X PATCH ${dspace7-url}/api/authz/resourcepolicies/${resourcepolicy-id} `
223+
224+ ```
225+ curl --data '[ { "op": "remove", "path": "/startDate" }]'
226+ -H 'Authorization: Bearer ...' \
227+ -H 'content-type: application/json' \
228+ -X PATCH \
229+ '${dspace7-url}/api/authz/resourcepolicies/${resourcepolicy-id}'
230+ ```
211231
212232that will transform
213233
@@ -245,7 +265,14 @@ Return codes, see also general [return codes for PATCH requests](patch.md#error-
245265The replace operation allows to replace * existent* information with new one. Attempt to use the replace operation to set not yet initialized information must return an error. See [ general errors on PATCH requests] ( patch.md )
246266
247267To change the startDate
248- ` curl --data '[ { "op": "replace", "path": "/startDate", "value": "2020-01-01" }]' -H "Authorization: Bearer ..." -H "content-type: application/json" -X PATCH ${dspace7-url}/api/authz/resourcepolicies/${resourcepolicy-id} `
268+
269+ ```
270+ curl --data '[ { "op": "replace", "path": "/startDate", "value": "2020-01-01" }]' \
271+ -H 'Authorization: Bearer ...' \
272+ -H 'content-type: application/json' \
273+ -X PATCH \
274+ '${dspace7-url}/api/authz/resourcepolicies/${resourcepolicy-id}'
275+ ```
249276
250277For example, starting with the following item data:
251278
@@ -310,9 +337,14 @@ Return codes:
310337Update the eperson linked by this resource policy
311338
312339Sample CURL command:
340+
313341```
314- curl -i -X PUT 'https://demo.dspace.org/server/api/authz/resourcepolicies/3/eperson' -H 'Authorization: Bearer eyJhbGciOiJ…' -H "Content-Type:text/uri-list" --data 'https://demo.dspace.org/server/api/eperson/epersons/ba05e3dd-aa20-4441-ac05-8ceef6f67ac7'
342+ curl -X PUT '${dspace7-url}/api/authz/resourcepolicies/3/eperson' \
343+ -H 'Authorization: Bearer eyJhbGciOiJ…' \
344+ -H 'Content-Type:text/uri-list' \
345+ --data '${dspace7-url}/api/eperson/epersons/ba05e3dd-aa20-4441-ac05-8ceef6f67ac7'
315346```
347+
316348The uri-list should always contain exactly 1 eperson. This eperson will be assigned to the resource policy
317349
318350Return codes:
@@ -342,9 +374,14 @@ Return codes:
342374Update the group linked by this resource policy
343375
344376Sample CURL command:
377+
345378```
346- curl -i -X PUT 'https://demo.dspace.org/server/api/authz/resourcepolicies/4/group' -H 'Authorization: Bearer eyJhbGciOiJ…' -H "Content-Type:text/uri-list" --data 'https://demo.dspace.org/server/api/eperson/groups/db337ae5-abd2-4a28-b4ad-918cf7779e25'
379+ curl -X PUT '${dspace7-url}/api/authz/resourcepolicies/4/group' \
380+ -H 'Authorization: Bearer eyJhbGciOiJ…' \
381+ -H 'Content-Type:text/uri-list' \
382+ --data '${dspace7-url}/api/eperson/groups/db337ae5-abd2-4a28-b4ad-918cf7779e25'
347383```
384+
348385The uri-list should always contain exactly 1 group. This group will be assigned to the resource policy
349386
350387Return codes:
0 commit comments