Skip to content

Commit

Permalink
Updated epersons.md
Browse files Browse the repository at this point in the history
Removed the metadata operations from epersons.md

Added the email patch operation and a note for administrator privilege operations.
  • Loading branch information
mspalti committed Feb 15, 2019
1 parent 51d43da commit 709cd2b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion epersons.md
Expand Up @@ -12,6 +12,7 @@
### Replace
The 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)

#### These operations can be performed by administrators.

To replace the certificate required value, `curl -X PATCH http://${dspace.url}/api/epersons/eperson/<:id-eperson> -H "Content-Type: application/json" -d '[{ "op": "replace", "path": "/certificate", "value": "true|false"]'`. The operation also requires an Authorization header.

Expand Down Expand Up @@ -44,6 +45,7 @@ the replace operation `[{ "op": "replace", "path": "/netid", "value": "newNetId"
```json
"netid": "newNetId",
```
#### This operation can be performed by administrators and by the authenticated user.

To replace the password value, `curl -X PATCH http://${dspace.url}/api/epersons/eperson/<:id-eperson> -H "Content-Type: application/json" -d '[{ "op": "replace", "path": "/password", "value": "newpassword"]'`. The operation also requires an Authorization header.

Expand All @@ -55,4 +57,14 @@ the replace operation `[{ "op": "replace", "path": "/password", "value": "newpas
```json
"password": "newpassword",
```
Note: The new password is currently returned after an update but this could be revisited later, see [#30]((https://github.com/DSpace/Rest7Contract/issues/30))
NOTE: The new password is currently returned after an update but this could be revisited later, see [#30]((https://github.com/DSpace/Rest7Contract/issues/30))

To replace the email value, `curl -X PATCH http://${dspace.url}/api/epersons/eperson/<:id-eperson> -H "Content-Type: application/json" -d '[{ "op": "replace", "path": "/email", "value": "new@email"]'`. The operation also requires an Authorization header.

For example, starting with the following eperson field data:
```json
"email": "old@email",
```
the replace operation `[{ "op": "replace", "path": "/email", "value": "new@email"]` will result in :
```json
"email": "new@email",

0 comments on commit 709cd2b

Please sign in to comment.