Element[] owners = PermissionsXML.getSelectedOwners(session);
for (int j= 0; j < owners.length ; j++){
if (log.isDebugEnabled())
log.debug("analyzing owner "+owners[j].getAttribute("name"));
String ownerKey = owners[j].getAttribute("token");
IPermissionManager pm = AuthorizationService.instance().newPermissionManager(ownerKey);
String[] acts = null;
if (session.gotActivities){
acts = PermissionsXML.getSelectedActivities(session,owners[j]);
}
String[] tgts = null;
if (session.gotTargets){
tgts = PermissionsXML.getSelectedTargets(session,owners[j]);
}
if (acts != null){
for (int a = 0; a< acts.length ; a++){
if (tgts != null){
for (int t=0; t< tgts.length; t++){
populateMembers(gmembers,pm.getAuthorizedPrincipals(acts[a],tgts[t]));
}
}
else {
populateMembers(gmembers,pm.getAuthorizedPrincipals(acts[a], null));
}
}
}
else {
if (tgts !=null){
for (int t=0; t< tgts.length; t++){
populateMembers(gmembers,pm.getAuthorizedPrincipals(null,tgts[t]));
}
}
else {
populateMembers(gmembers,pm.getAuthorizedPrincipals(null, null));
}
}
// use pre-populated list to get servant
session.servant = CGroupsManagerServantFactory.getGroupsServantforSelection(