Skip to content

Commit

Permalink
Update Native API guide
Browse files Browse the repository at this point in the history
  • Loading branch information
luddaniel committed Jun 5, 2024
1 parent 007b2d4 commit c29a9af
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions doc/sphinx-guides/source/api/native-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4249,12 +4249,12 @@ The JSON representation of a role (``roles.json``) looks like this::
{
"alias": "sys1",
"name": Restricted System Role,
"description": A person who may only add datasets.,
"name": "Restricted System Role",
"description": "A person who may only add datasets.",
"permissions": [
"AddDataset"
]
}
}
.. note:: alias is constrained to a length of 16 characters
Expand Down Expand Up @@ -5313,9 +5313,25 @@ Creates a global role in the Dataverse installation. The data POSTed are assumed
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export SERVER_URL=https://demo.dataverse.org
export ID=root
curl -H "X-Dataverse-key:$API_TOKEN" -X POST "$SERVER_URL/api/admin/roles" --upload-file roles.json
curl -H "Content-Type: application/json" -H "X-Dataverse-key:$API_TOKEN" -X POST "$SERVER_URL/api/admin/roles" --upload-file roles.json
``roles.json`` see :ref:`json-representation-of-a-role`
Update Global Role
~~~~~~~~~~~~~~~~~~
Update a global role in the Dataverse installation. The data PUTed are assumed to be a role JSON. ::
POST http://$SERVER/api/admin/roles
.. code-block:: bash
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export SERVER_URL=https://demo.dataverse.org
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
``roles.json`` see :ref:`json-representation-of-a-role`
Expand Down

0 comments on commit c29a9af

Please sign in to comment.