Iterator i = accessRightRoleList.iterator();
while(i.hasNext())
{
AccessRightRole accessRightRole = (AccessRightRole)i.next();
AccessRight accessRight = accessRightRole.getAccessRight();
if(accessRight != null)
{
boolean exists = false;
Iterator rolesIterator = accessRight.getRoles().iterator();
while(rolesIterator.hasNext())
{
AccessRightRole currentAccessRightRole = (AccessRightRole)rolesIterator.next();
if(currentAccessRightRole.getRoleName().equals(newRoleName))
exists = true;
}
if(!exists)
{
//accessRightRole.setRoleName(newRoleName);
AccessRightRoleVO accessRightRoleVO = new AccessRightRoleVO();
accessRightRoleVO.setRoleName(newRoleName);
AccessRightRole newAccessRightRole = AccessRightController.getController().createAccessRightRole(db, accessRightRoleVO, accessRight);
accessRight.getRoles().add(newAccessRightRole);
}
}
}
}