{
roles = new LinkedList();
Iterator fullRoles = roleManager.getRoles("");
while (fullRoles.hasNext())
{
Role role = (Role)fullRoles.next();
roles.add(role.getPrincipal().getName());
}
request.getPortletSession().setAttribute(ROLES_CONTROL, roles);
}
}
catch (SecurityException se)
{
throw new PortletException(se);
}
ArrayList selectableRoles = new ArrayList(roles);
Iterator rolesIter = userRoles.iterator();
while ( rolesIter.hasNext() )
{
Role role = (Role)rolesIter.next();
int index = selectableRoles.indexOf(role.getPrincipal().getName());
if (index != -1)
{
selectableRoles.remove(index);
}
}