Maintenance: Planio will be observing a scheduled maintenance window this Tuesday, November 5, 2024 from 03:00 UTC until 06:30 UTC to perform urgent network maintenance in our primary data center. Your Planio account will be unavailable during this maintenance window.
Story #7231
closedAs a user, I can Read Users, group membership, and their permissions via an API
100%
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/"
}
Updated by bmbouter over 4 years ago
- Subject changed from As a user, I can list all Pulp users to As a user, I can CRUD Users via an API
Updated by bmbouter over 4 years ago
- Subject changed from As a user, I can CRUD Users via an API to As a user, I can Read Users, group membership, and their permissions via an API
- Description updated (diff)
Updated by dkliban@redhat.com over 4 years ago
- Groomed changed from No to Yes
- Sprint set to Sprint 78
Updated by fao89 over 4 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to fao89
Updated by fao89 over 4 years ago
should I move it to pulpcore? https://github.com/ansible/galaxy_ng/blob/master/galaxy_ng/app/models/auth.py
Updated by bmbouter over 4 years ago
fao89 wrote:
should I move it to pulpcore? https://github.com/ansible/galaxy_ng/blob/master/galaxy_ng/app/models/auth.py
I don't think so, I believe we want to continue using the vanilla user model provided by Django.
Updated by pulpbot over 4 years ago
- Status changed from ASSIGNED to POST
Added by Fabricio Aguiar about 4 years ago
Updated by Anonymous about 4 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulpcore|6e6f599f2dcc27361a0c776834f812b95c776c6a.
Updated by pulpbot about 4 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Read API for Users, Group membership, and Permissions
https://pulp.plan.io/issues/7231 closes #7231