if (!agdl.getAdminGroupName().equals(PUBLICWEBGROUPNAME) && !(agdl.getAdminGroupName().equals(DEFAULTGROUPNAME) && agdl.getCAId() == ILogSessionLocal.INTERNALCAID))
if (!agdl.getAdminGroupName().equals(PUBLICWEBGROUPNAME) && !(agdl.getAdminGroupName().equals(DEFAULTGROUPNAME) && agdl.getCaId() == ILogSessionLocal.INTERNALCAID))
    public Collection getAuthorizedAdminGroupNames(Admin admin) {        ArrayList returnval = new ArrayList();        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));        }        try {            Collection result = admingrouphome.findAll();            Iterator i = result.iterator();            while (i.hasNext()) {                AdminGroupDataLocal agdl = (AdminGroupDataLocal) i.next();                boolean allauthorized = false;                boolean carecursive = false;                boolean superadmingroup = false;                boolean authtogroup = false;                ArrayList groupcaids = new ArrayList();                if (!issuperadmin) {                    // Is admin authorized to group caid.                    if (authorizedcaids.contains(new Integer(agdl.getCAId()))) {                        authtogroup = true;                        // check access rules                        Iterator iter = agdl.getAccessRuleObjects().iterator();                        while (iter.hasNext()) {                            AccessRule accessrule = ((AccessRule) iter.next());                            String rule = accessrule.getAccessRule();                            if (rule.equals(AvailableAccessRules.ROLE_SUPERADMINISTRATOR) && accessrule.getRule() == AccessRule.RULE_ACCEPT) {                                superadmingroup = true;                                break;                            }                            if (rule.equals(AvailableAccessRules.CABASE)) {                                if (accessrule.getRule() == AccessRule.RULE_ACCEPT && accessrule.isRecursive()) {                                    if (authorizedcaids.containsAll(allcaids)) {                                        carecursive = true;                                    }                                }                            } else {                                if (rule.startsWith(AvailableAccessRules.CAPREFIX) && accessrule.getRule() == AccessRule.RULE_ACCEPT) {                                    groupcaids.add(new Integer(rule.substring(AvailableAccessRules.CAPREFIX.length())));                                }                            }                        }                    }                }                allauthorized = authorizedcaids.containsAll(groupcaids);                if (issuperadmin || ((allauthorized || carecursive) && authtogroup && !superadmingroup)) {                    if (!agdl.getAdminGroupName().equals(PUBLICWEBGROUPNAME) && !(agdl.getAdminGroupName().equals(DEFAULTGROUPNAME) && agdl.getCAId() == ILogSessionLocal.INTERNALCAID))                        returnval.add(agdl.getAdminGroupNames());                }            }        } catch (FinderException e) {        }        return returnval;    } // getAuthorizedAdminGroupNames