Bug 1281773 - Missing API call to list roles of a user
Summary: Missing API call to list roles of a user
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Users & Roles
Version: 6.1.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks: 1122832
TreeView+ depends on / blocked
 
Reported: 2015-11-13 12:13 UTC by Peter Vreman
Modified: 2015-11-13 12:19 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-13 12:19:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Peter Vreman 2015-11-13 12:13:29 UTC
Description of problem:
The API does not have a possiblity to list all roles assigned to a user

Currently the API provides only a GET request to list all users for a role:

/usr/share/foreman/app/controllers/api/v2# grep roles *
roles_controller.rb:      api :GET, "/roles/", N_("List all roles")
roles_controller.rb:        @roles = resource_scope_for_index
roles_controller.rb:      api :GET, "/roles/:id/", N_("Show a role")
roles_controller.rb:      api :POST, "/roles/", N_("Create a role")
roles_controller.rb:      api :PUT, "/roles/:id/", N_("Update a role")
roles_controller.rb:      api :DELETE, "/roles/:id/", N_("Delete a role")
users_controller.rb:      api :GET, "/roles/:role_id/users", N_("List all users for role")

There is no route for GET /users/:user_id/roles


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Use the API to list roles assigned to a user
2.
3.

Actual results:
No API call available

Expected results:
GET /users/:user_id/roles available

Additional info:

Comment 1 Peter Vreman 2015-11-13 12:19:55 UTC
The /users/:user_id already includes the information


Note You need to log in before you can comment on or make changes to this bug.