Actions
Story #7231
closedAs a user, I can Read Users, group membership, and their permissions via an API
Start date:
Due date:
% Done:
100%
Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
No
Tags:
Sprint:
Sprint 79
Quarter:
Description
Background¶
Users need to:
- List all users
- View a single user
- View group membership for that user
- View user and group permissions for that user
URL¶
-
GET /pulp/api/v3/users/
- the list view -
GET /pulp/api/v3/users/:uuid/
- the detail view -
GET /pulp/api/v3/users/:uuid/permissions/
- list all permissions view
The model¶
This is defined by Django: https://github.com/django/django/blob/7af8f4127397279d19ef7c7899e93018274e2f9b/django/contrib/auth/models.py#L321-L356
/pulp/api/v3/users/:uuid/
Serializer
- username - https://github.com/django/django/blob/7af8f4127397279d19ef7c7899e93018274e2f9b/django/contrib/auth/models.py#L330-L339
- first_name - https://github.com/django/django/blob/7af8f4127397279d19ef7c7899e93018274e2f9b/django/contrib/auth/models.py#L340
- last_name - https://github.com/django/django/blob/7af8f4127397279d19ef7c7899e93018274e2f9b/django/contrib/auth/models.py#L341
- email - https://github.com/django/django/blob/7af8f4127397279d19ef7c7899e93018274e2f9b/django/contrib/auth/models.py#L342
- is_staff - https://github.com/django/django/blob/7af8f4127397279d19ef7c7899e93018274e2f9b/django/contrib/auth/models.py#L343-L347
- is_active - https://github.com/django/django/blob/7af8f4127397279d19ef7c7899e93018274e2f9b/django/contrib/auth/models.py#L348-L355
- date_joined - https://github.com/django/django/blob/7af8f4127397279d19ef7c7899e93018274e2f9b/django/contrib/auth/models.py#L356
- groups - a list-style URL Field to the groups the user is a member of for example:
A list of entries like:
{
"group_name": "foo",
"pulp_href": "/pulp/api/v3/groups/<UUID_HERE>/"
}
/pulp/api/v3/users/:uuid/permissions/
Serializer
Each permission entry for model-level permission should have:
{
"name": "file.view_fileremote",
"obj": None
}
Each permission entry for the object-level permission should have:
{
"name": "file.view_fileremote",
"obj": "/pulp/api/v3/remotes/file/file/<UUID_HERE/"
}
Actions
Read API for Users, Group membership, and Permissions
https://pulp.plan.io/issues/7231 closes #7231