}
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 enum1 = user.getGroupRoles().elements(); enum1.hasMoreElements();)
{
st = new StringTokenizer((String)enum1.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();
}