Bug 773237

Summary: Not possible to see children resources for a custom role
Product: [Other] RHQ Project Reporter: vlad crc <vlad.craciunoiu>
Component: Core UIAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED DUPLICATE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.2CC: hrupp, lkrejci
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-16 20:41:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description vlad crc 2012-01-11 10:21:36 UTC
Description of problem:
It is not possible to see the children of a resource if you are logged in with a user having a custom role, with resource permissions only.


Version-Release number of selected component:
4.2


How reproducible:
Always


Steps to Reproduce:
1. login as "rhqadmin".
2. assume you have one platform imported, containing a JBoss 4.2.3 server and the RHQ agent.
3. create a group called "mygroup" containing this platform.
4. create a role named "operator".
5. give it no global permissions.
6. give it resource permissions:
    - all IMPLIED
    - inventory Read&Write
    - manage measurements Read&Write
    - manage alerts: Read&Write
    - control: Read&Write
    - manage events: Read&Write
7. create a new user "tom"
8. assign "tom" the "operator" role
9. assign "mygroup" to "operator" role
10. logout
11. login as "tom"
12. go to "Inventory / Platforms"
13. select the platform
14. in the resources tree on the left side, try to expand the JBoss resource or the RHQ-Agent resource.

  
Actual results:
Children are not displayed. On the top banner I get the error message "Failed to load children for node".
In "message center" the details are these:

---------------------------------------------------------------------
java.lang.RuntimeException:[1326275804239] org.rhq.enterprise.server.authz.PermissionException:Subject [tom] requires InventoryManager permission for requested query criteria.
---------------------------------------------------------------------


Expected results:
I should be able to normally browse the children of JBoss or RHQ-Agent.

In RHQ server log there is this exception:
---------------------------------------------------------------------
2012-01-11 11:01:45,931 WARN  [gwt-log] Sending exception to client: [1326276105930]
org.rhq.enterprise.server.authz.PermissionException: Subject [tom] requires InventoryManager permission for requested query criteria.
        at org.rhq.enterprise.server.resource.ResourceManagerBean.findResourcesByCriteria(ResourceManagerBean.java:2452)
---------------------------------------------------------------------


Additional info:
If I go to "Inventory / All groups" and select "mygroup", then it's "Inventory" tab, in the list of members click on the JBoss then in the resources tree, I can see all the JBoss children normally.

Comment 1 Mike Foley 2012-01-16 20:41:49 UTC

*** This bug has been marked as a duplicate of bug 773225 ***

Comment 2 Lukas Krejci 2012-01-27 10:08:21 UTC

*** This bug has been marked as a duplicate of bug 773235 ***