Skip to content

Commit

Permalink
Update doc after review
Browse files Browse the repository at this point in the history
  • Loading branch information
luddaniel committed Jun 12, 2024
1 parent 9d0004d commit 52d72d3
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions doc/sphinx-guides/source/api/native-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5312,7 +5312,7 @@ Creates a global role in the Dataverse installation. The data POSTed are assumed
.. code-block:: bash
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export SERVER_URL=https://demo.dataverse.org
export SERVER_URL=http://localhost:8080
curl -H "Content-Type: application/json" -H "X-Dataverse-key:$API_TOKEN" -X POST "$SERVER_URL/api/admin/roles" --upload-file roles.json
Expand All @@ -5321,29 +5321,34 @@ Creates a global role in the Dataverse installation. The data POSTed are assumed
Update Global Role
~~~~~~~~~~~~~~~~~~
Update a global role in the Dataverse installation. The data PUTed are assumed to be a role JSON. ::
Update a global role in the Dataverse installation. The PUTed data is assumed to be a complete JSON role as it will overwrite the existing role. ::
POST http://$SERVER/api/admin/roles
PUT http://$SERVER/api/admin/roles/$ID
A curl example using an ``ID``
.. code-block:: bash
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export SERVER_URL=https://demo.dataverse.org
export SERVER_URL=http://localhost:8080
export ID=24
curl -H "Content-Type: application/json" -H "X-Dataverse-key:$API_TOKEN" -X PUT "$SERVER_URL/api/admin/roles/$ID" --upload-file roles.json
curl -H "Content-Type: application/json" -X PUT "$SERVER_URL/api/admin/roles/$ID" --upload-file roles.json
``roles.json`` see :ref:`json-representation-of-a-role`
Delete Global Role
~~~~~~~~~~~~~~~~~~
Deletes an ``DataverseRole`` whose ``id`` is passed. ::
DELETE http://$SERVER/api/admin/roles/$ID
A curl example using an ``ID``
.. code-block:: bash
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export SERVER_URL=https://demo.dataverse.org
export SERVER_URL=http://localhost:8080
export ID=24
curl -H "X-Dataverse-key:$API_TOKEN" -X DELETE "$SERVER_URL/api/admin/roles/$ID"
Expand Down

0 comments on commit 52d72d3

Please sign in to comment.