mirror of
https://github.com/inventree/inventree-docs.git
synced 2025-04-28 13:46:54 +00:00
Add docs for API roles
This commit is contained in:
parent
2c5bd7ed80
commit
48d6acba97
BIN
docs/assets/images/api/api_roles.png
Normal file
BIN
docs/assets/images/api/api_roles.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
BIN
docs/assets/images/api/api_roles_2.png
Normal file
BIN
docs/assets/images/api/api_roles_2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
@ -76,3 +76,29 @@ headers = {
|
|||||||
}
|
}
|
||||||
response = request.get('http://localhost:8080/api/part/', data=data, headers=headers)
|
response = request.get('http://localhost:8080/api/part/', data=data, headers=headers)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Authorization
|
||||||
|
|
||||||
|
### User Roles
|
||||||
|
|
||||||
|
Users can only perform REST API actions which align with their assigned [role permissions](../../admin/permissions/#roles).
|
||||||
|
Once a user has *authenticated* via the API, a list of the available roles can be retrieved from:
|
||||||
|
|
||||||
|
`/api/user/roles/`
|
||||||
|
|
||||||
|
For example, when accessing the API from a *superuser* account:
|
||||||
|
|
||||||
|
{% with id="api_roles", url="api/api_roles.png", description="API superuser roles" %}
|
||||||
|
{% include 'img.html' %}
|
||||||
|
{% endwith %}
|
||||||
|
|
||||||
|
Or, when accessing the API from an account which has read-only permissions:
|
||||||
|
|
||||||
|
{% with id="api_roles_2", url="api/api_roles_2.png", description="API user roles" %}
|
||||||
|
{% include 'img.html' %}
|
||||||
|
{% endwith %}
|
||||||
|
|
||||||
|
### Permission Denied
|
||||||
|
|
||||||
|
If an API action outside of the user's role(s) is attempted, the server will respond with a 403 permission error message.
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ Label printing functionality has been simplified and brought into line with the
|
|||||||
|
|
||||||
### API Permissions
|
### API Permissions
|
||||||
|
|
||||||
[#1363](https://github.com/inventree/InvenTree/pull/1363) enforces user role permissions onto the REST API endpoints. Authenticated users can now only perform REST actions which align with their allocated role(s).
|
[#1363](https://github.com/inventree/InvenTree/pull/1363) enforces user role permissions onto the REST API endpoints. Authenticated users can now only perform REST actions which align with their allocated role(s). Refer to the [API documentation](../../extend/api/#authorization) for further information.
|
||||||
|
|
||||||
## Major Bug Fixes
|
## Major Bug Fixes
|
||||||
| PR | Description |
|
| PR | Description |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user