Bug 1424842 - Setting report menus via the API breaks report menus
Summary: Setting report menus via the API breaks report menus
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.6.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.9.0
Assignee: Tim Wade
QA Contact: Niyaz Akhtar Ansari
URL:
Whiteboard: report:api
Depends On: 1541324
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-19 19:15 UTC by myoder
Modified: 2021-06-10 11:57 UTC (History)
6 users (show)

Fixed In Version: 5.9.0.3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-01 13:09:52 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:0380 0 normal SHIPPED_LIVE Moderate: Red Hat CloudForms security, bug fix, and enhancement update 2018-03-01 18:37:12 UTC

Description myoder 2017-02-19 19:15:29 UTC
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 18:51:45 UTC
PR: https://github.com/ManageIQ/manageiq/pull/16142

Comment 7 errata-xmlrpc 2018-03-01 13:09:52 UTC
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.