Skip to content

Commit

Permalink
add change from 401 to 403 for /api/roles, improve docs #10340
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Dec 20, 2024
1 parent caa00fb commit f99d67e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/sphinx-guides/source/api/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ v6.6
----

- **/api/metadatablocks** is no longer returning duplicated metadata properties and does not omit metadata properties when called.
- **/api/roles**: :ref:`show-role` now properly returns 403 Forbidden instead of 401 Unauthorized when you pass a working API token that doesn't have the right permission.

v6.5
----
Expand Down
14 changes: 12 additions & 2 deletions doc/sphinx-guides/source/api/native-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4563,12 +4563,22 @@ Create Role
Roles can be created globally (:ref:`create-global-role`) or for individual Dataverse collections (:ref:`create-role-in-collection`).
.. _show-role:
Show Role
~~~~~~~~~
Shows the role with ``id``::
You must have ``ManageDataversePermissions`` to be able to show a role that was created using :ref:`create-role-in-collection`. Global roles (:ref:`create-global-role`) only be shown with a superuser API token.
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 ID=11
GET http://$SERVER/api/roles/$id
curl -H "X-Dataverse-key:$API_TOKEN" "$SERVER_URL/api/roles/$ID"
Delete Role
~~~~~~~~~~~
Expand Down

0 comments on commit f99d67e

Please sign in to comment.