Bug 1281773 - Missing API call to list roles of a user
Missing API call to list roles of a user
Status: CLOSED NOTABUG
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Users & Roles (Show other bugs)
6.1.3
Unspecified Unspecified
unspecified Severity unspecified (vote)
: Unspecified
: --
Assigned To: satellite6-bugs
Katello QA List
:
Depends On:
Blocks: 1122832
  Show dependency treegraph
 
Reported: 2015-11-13 07:13 EST by Peter Vreman
Modified: 2015-11-13 07:19 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-13 07:19:55 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Peter Vreman 2015-11-13 07:13:29 EST
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 07:19:55 EST
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.