<<<<<<<<<<<<<< public Iterator getRoles(String username) throws JetspeedSecurityException { StringTokenizer st; LDAPUser user; try { if (cachingEnable) { Iterator result = JetspeedSecurityCache.getRoles(username); if (null != result) { return result; } } user = (LDAPUser)JetspeedSecurity.getUser(new UserNamePrincipal(username)); } catch(JetspeedSecurityException e) { throw new RoleException("Failed to Retrieve User: ", e); } HashMap roles= new HashMap(); try { for (Enumeration enum = user.getGroupRoles().elements(); enum.hasMoreElements();) { //String data "groupName,roleName" st = new StringTokenizer((String)enum.nextElement(), ","); LDAPGroup group = new LDAPGroup(st.nextToken(),false); LDAPRole role = new LDAPRole(st.nextToken(),false); BaseJetspeedGroupRole groupRole = new BaseJetspeedGroupRole(); groupRole.setGroup(group); groupRole.setRole(role); roles.put(group.getName() + role.getName(), groupRole); } } catch(Exception e) { throw new RoleException("Failed to retrieve groups ", e); } return roles.values().iterator(); } >>>>>>>>>>