fixed listGroupsByUserAndSite that was assuming one Group sould belonging to One Virtual Group only
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vo-management/usermanagement-core@140046 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
37ea7ef3d8
commit
27bac2af8c
|
@ -422,13 +422,19 @@ public class LiferayGroupManager implements GroupManager {
|
|||
Set<GCubeGroup> toReturn = new HashSet<>();
|
||||
try {
|
||||
List<VirtualGroup> currSiteVirtualGroups = getVirtualGroups(ManagementUtils.getSiteGroupIdFromServletRequest(serverName));
|
||||
|
||||
for (GCubeGroup userGroup : listGroupsByUser(userId)) {
|
||||
if (isVRE(userGroup.getGroupId())) {
|
||||
for (VirtualGroup vg : currSiteVirtualGroups)
|
||||
if (getVirtualGroup(userGroup.getGroupId()).getName().compareTo(vg.getName()) == 0)
|
||||
toReturn.add(userGroup);
|
||||
for (VirtualGroup currSiteVGroup : currSiteVirtualGroups) {
|
||||
List<VirtualGroup> vGroups = getVirtualGroups(userGroup.getGroupId());
|
||||
for (VirtualGroup virtualGroup : vGroups) {
|
||||
if (virtualGroup.getName().compareTo(currSiteVGroup.getName()) == 0)
|
||||
toReturn.add(userGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -616,7 +622,10 @@ public class LiferayGroupManager implements GroupManager {
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
/**
|
||||
* to be removed in the next release
|
||||
*/
|
||||
private VirtualGroup getVirtualGroup(long actualGroupId) throws GroupRetrievalFault, VirtualGroupNotExistingException {
|
||||
VirtualGroup toReturn = new VirtualGroup();
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue