Bug 749538 - When two roles with the same resource group are assigned to the user, the list of all resources is not distinct - contains duplicated resources
When two roles with the same resource group are assigned to the user, the lis...
Product: RHQ Project
Classification: Other
Component: Core Server (Show other bugs)
Unspecified Unspecified
high Severity low (vote)
: ---
: RHQ 4.3.0
Assigned To: Ian Springer
Mike Foley
Depends On:
Blocks: jon310-sprint11/rhq44-sprint11
  Show dependency treegraph
Reported: 2011-10-27 07:57 EDT by bkramer
Modified: 2013-08-05 20:41 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-02-02 10:59:09 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description bkramer 2011-10-27 07:57:55 EDT
Description of problem:
Two roles have been assigned to the user. The same resource group is assigned to both roles. When new user log in and select Resources -> All Resources, resulted table will contain duplicated resources. At the same time resource number will be correct. The same happens when select Groups -> All Groups.

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

How reproducible:
every time

Steps to Reproduce:
1. Create a non-recursive group (for instance dynamic group that contains all platforms);
2. Create a new user;
3. Create two new roles (for instance JON-Admin:Administer JON Server settings true and Developer-Read:Subsystem Permissions -> Configure set to true)   and assign to each of them newly created user and newly created group.
4. Log out and log in again using user name and password for that is given to the new user;
5) Select Resources -> All Resources
Actual results:
Resulted table contains duplicated number of resources;

Expected results:
Resulted table contains correct number of resources

Additional info:
The same happens if the user select Groups -> All Groups. At the same time, the number of the resources (groups) is correct.
Comment 1 Charles Crouch 2011-10-31 12:07:50 EDT
Is the workaround to use two distinct groups (but with the same members) when 
creating the roles?
Comment 2 bkramer 2011-11-02 04:49:53 EDT
(In reply to comment #1)
> Is the workaround to use two distinct groups (but with the same members) when 
> creating the roles?

That fixes the "All Group" page - as the number of the groups is 2 and it does show 2 groups. But the page "All Resources" still shows duplicated resources.
Comment 3 Ian Springer 2012-02-02 10:43:35 EST
I have reproduced this on JON 2.4.2. However, I was *not* able to reproduce it with JON 3.0.1-SNAPSHOT or RHQ 4.3.0-SNAPSHOT, so it appears to be fixed in more current branches.
Comment 4 Ian Springer 2012-02-02 10:51:47 EST
In JON 2.4.2, I also see the duplicate Resources when using the CLI:

tester@localhost:7080$ ResourceManager.findResourcesByCriteria(new ResourceCriteria())
id    name  version   currentAvailability resourceType
10016 CPU 0 Pentium 4 UP                  CPU         
10016 CPU 0 Pentium 4 UP                  CPU         
2 rows

This tells me the bug is in the Server (probably either an SLSB or the criteria engine), and not in the GUI.

Note, I do *not* see duplicate Resources in the CLI with JON 3.0.1-SNAPSHOT or RHQ 4.3.0-SNAPSHOT.
Comment 5 Charles Crouch 2012-02-02 10:59:09 EST
Given Ian's comments this will definitely be fixed in JON3.0.1 and I would expect it to be fixed in JON3.0.0 too

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