HashSet authorizedcaids = new HashSet(authorizer.getAuthorizedCAIds(admin));
boolean issuperadmin = false; try { issuperadmin = this.isAuthorizedNoLog(admin, AvailableAccessRules.ROLE_SUPERADMINISTRATOR); } catch (AuthorizationDeniedException e1) {	} HashSet authorizedcaids = new HashSet(); HashSet allcaids = new HashSet(); if(!issuperadmin){ authorizedcaids.addAll(authorizer.getAuthorizedCAIds(admin)); allcaids.addAll(getCAAdminSession().getAvailableCAs(admin)); }
     public Collection getAuthorizedAdminGroupNames(Admin admin){       ArrayList returnval = new ArrayList();       HashSet authorizedcaids = new HashSet(authorizer.getAuthorizedCAIds(admin));       try{         Collection result = admingrouphome.findAll();         Iterator i = result.iterator();         while(i.hasNext()){            AdminGroupDataLocal agdl = (AdminGroupDataLocal) i.next();            if(authorizedcaids.contains(new Integer(agdl.getCAId()))){               // check access rules                Iterator iter = agdl.getAccessRuleObjects().iterator();                boolean allauthorized = true;              while(iter.hasNext()){              	AccessRule accessrule = ((AccessRule) iter.next());                String rule = accessrule.getAccessRule();                if(rule.equals(AvailableAccessRules.CABASE)){                	if(accessrule.getRule() == AccessRule.RULE_ACCEPT && accessrule.isRecursive()){                	  allauthorized= true;                      break;                	}                }else{                                  if(rule.startsWith(AvailableAccessRules.CAPREFIX) && accessrule.getRule() == AccessRule.RULE_ACCEPT){                      if(!authorizedcaids.contains(new Integer(rule.substring(AvailableAccessRules.CAPREFIX.length())))){                       allauthorized=false;                       }                  }                }                }              if(allauthorized)                if(!(agdl.getAdminGroupName().equals(DEFAULTGROUPNAME) && agdl.getCAId() == ILogSessionLocal.INTERNALCAID))                    returnval.add(agdl.getAdminGroupNames());              }         }       }catch(FinderException e){}       return returnval;     } // getAuthorizedAdminGroupNames