Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
The API to query fact values always has an empty response because of lack of permissions with the Viewer role. Neither could the View-Host and Manager roles, so looks like that only the Administrator role can list the facts.
This behavior is a regression over Sat6.0, as the same user role and query
works without issues on Sat6.0 and earlier Foreman 1.2 installations.
$ curl -s -uviewer:xxxx https://li-lc-1578.hag.hilti.com/api/v2/users/viewer | jq .roles
[
{
"id": 19,
"name": "Anonymous"
},
{
"id": 16,
"name": "Viewer"
}
]
$ curl -s -uviewer:xxxx https://li-lc-1578.hag.hilti.com//api/v2/hosts/li-lc-1443.hag.hilti.com/facts?per_page=9999 | jq .
{
"results": {},
"sort": {
"order": null,
"by": null
},
"search": " host = li-lc-1443.hag.hilti.com",
"per_page": 9999,
"page": 1,
"subtotal": 0,
"total": 0
}
2015-10-05 11:46:07 [I] Processing by Api::V2::FactValuesController#index as JSON
2015-10-05 11:46:07 [I] Parameters: {"per_page"=>"9999", "apiv"=>"v2", "host_id"=>"li-lc-1443.hag.hilti.com"}
2015-10-05 11:46:07 [I] Authorized user viewer(viewer )
2015-10-05 11:46:07 [I] Rendered api/v2/fact_values/index.json.rabl within api/v2/layouts/index_layout (3.0ms)
2015-10-05 11:46:07 [I] Completed 200 OK in 341ms (Views: 27.8ms | ActiveRecord: 47.8ms)
Version-Release number of selected component (if applicable):
How reproducible:
Steps to Reproduce:
1. Query facts using a User with only the Viewer role
2.
3.
Actual results:
No facts returned
Expected results:
Facts returned
Additional info:
Moving to POST since upstream bug http://projects.theforeman.org/issues/9793 has been closed
-------------
Daniel Lobato Garcia
Applied in changeset commit:f0c7b9616ffe83a6e8aa0a0c5811c22d541daa1c.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2016:1500