Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2.0
-
None
Description
When I make an association between two groups, the methods getGroupsAssociatedTo and getGroupsAssociatedFrom returns the same result. for example:
this.groupManager.addGroupToGroup(AA, BB, JetspeedPrincipalAssociationType.IS_PART_OF);
This returns two records:
List <Group> lista = this.groupManager.getGroupsAssociatedTo(AA, JetspeedPrincipalAssociationType.IS_PART_OF );
List <Group> lista = this.groupManager.getGroupsAssociatedFrom(AA, JetspeedPrincipalAssociationType.IS_PART_OF );
This returno no records:
List <Group> lista = this.groupManager.getGroupsAssociatedTo(BB, JetspeedPrincipalAssociationType.IS_PART_OF );
List <Group> lista = this.groupManager.getGroupsAssociatedFrom(BB, JetspeedPrincipalAssociationType.IS_PART_OF );
I think the problem is in class [GroupManagerImpl], who extends [BaseJetspeedPrincipalManager]. GroupManagerImpl has "getGroupsAssociatedFrom" and "getGroupsAssociatedTo" methods, but both call the same method of [BaseJetspeedPrincipalManager]:
/* (non-Javadoc)
- @see org.apache.jetspeed.security.GroupManager#getGroupsAssociatedFrom(org.apache.jetspeed.security.Group, java.lang.String)
*/
@SuppressWarnings("unchecked")
public List<Group> getGroupsAssociatedFrom(Group from, String associationName) { return (List<Group>)getAssociatedFrom(from.getName(), from.getType(), associationName); }
/* (non-Javadoc)
- @see org.apache.jetspeed.security.GroupManager#getGroupsAssociatedTo(org.apache.jetspeed.security.Group, java.lang.String)
*/
@SuppressWarnings("unchecked")
public List<Group> getGroupsAssociatedTo(Group to, String associationName) { return (List<Group>)getAssociatedFrom(to.getName(), to.getType(), associationName); }
when "getGroupsAssociatedTo" method must call "BaseJetspeedPrincipalManager.getAssociatedTo", nor "BaseJetspeedPrincipalManager.getAssociatedFrom".
Regards
Francisco Rosado