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
Summary: When two roles with the same resource group are assigned to the user, the lis...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Core Server
Version: 3.0.1
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: ---
: RHQ 4.3.0
Assignee: Ian Springer
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: jon310-sprint11, rhq44-sprint11
TreeView+ depends on / blocked
 
Reported: 2011-10-27 11:57 UTC by bkramer
Modified: 2018-11-26 18:25 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-02-02 15:59:09 UTC
Embargoed:


Attachments (Terms of Use)

Description bkramer 2011-10-27 11:57:55 UTC
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 16:07:50 UTC
Is the workaround to use two distinct groups (but with the same members) when 
creating the roles?

Comment 2 bkramer 2011-11-02 08:49:53 UTC
(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 15:43:35 UTC
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 15:51:47 UTC
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 15:59:09 UTC
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.