Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1424842 - Setting report menus via the API breaks report menus
Setting report menus via the API breaks report menus
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API (Show other bugs)
5.6.0
Unspecified Unspecified
medium Severity medium
: GA
: 5.9.0
Assigned To: Tim Wade
Niyaz Akhtar Ansari
report:api
:
Depends On: 1541324
Blocks:
  Show dependency treegraph
 
Reported: 2017-02-19 14:15 EST by myoder
Modified: 2018-03-01 08:09 EST (History)
6 users (show)

See Also:
Fixed In Version: 5.9.0.3
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-03-01 08:09:52 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: Bug
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:0380 normal SHIPPED_LIVE Moderate: Red Hat CloudForms security, bug fix, and enhancement update 2018-03-01 13:37:12 EST

  None (edit)
Description myoder 2017-02-19 14:15:29 EST
Description of problem:

Using the API to set a report menu for a group puts invalid data in the database and results in all reports being displayed to the user.

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


How reproducible:
Always

Steps to Reproduce:
1. In the UI, set up custom report menu for a group. Say by removing folders.
2. Log in as a user in the group and verify the menu structure.
3. Pull down the JSON settings from the API. `curl -k -H "Accept: application/json" -u admin:smartvm  https://cfme-ui01/api/groups/<group_id>` > group_reports.json
4. Remove all values from the JSON except for the settings hash.
5. Send the data back to the server. ` curl -k -H "Content-Type: application/json" -H "Accept: application/json" -u admin:smartvm -X PUT -d @group_reports.json  https://cfme-ui01/api/groups/<group_id>`
6. Verify that the user's report menu is now invalid.

Actual results:


Expected results:


Additional info:
The root cause appears to be that the MiqGroup settings hash key is "reports_menu" (a string) when submitted via the API, but should be the symbol :reports_menu as is set when you edit via the UI.

You can recover from the issue by editing the group in the UI again or by manually setting the reports_menu array to a symbol key and deleting the string key via the Rails console.
Comment 3 Tim Wade 2017-10-06 14:51:45 EDT
PR: https://github.com/ManageIQ/manageiq/pull/16142
Comment 7 errata-xmlrpc 2018-03-01 08:09:52 EST
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/RHSA-2018:0380

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