final String[] readAllowedPrivs = new String[selectedRole.getUserRolePrivileges().size()];
final Map selPrivMap = new HashMap();
{
for(int i = 0; i < selectedRole.getUserRolePrivileges().size(); i++)
{
final RolePrivilegeVo rpvo = selectedRole.getUserRolePrivileges().get(i);
selPrivs[i] = rpvo.getUserRolePrivilege();
selPrivMap.put(rpvo.getUserRolePrivilege(), "true");
if(PrivilegeActionType.Key.READ_WRITE_KEY.equals(rpvo.getPrivilegeActions())) {
writeAllowedPrivs[i] = rpvo.getUserRolePrivilege();
}
//always read allowed
readAllowedPrivs[i] = rpvo.getUserRolePrivilege();
}
}
//now set them in the form
((ModifyRoleForm)form).setUserRolePrivileges( selPrivs );