logger.info("accessRightList:" + accessRightList.size());
Iterator accessRightListIterator = accessRightList.iterator();
while(accessRightListIterator.hasNext())
{
AccessRight accessRight = (AccessRight)accessRightListIterator.next();
logger.info("accessRight:" + accessRight.getId());
AccessRightVO copiedAccessRight = accessRight.getValueObject().createCopy();
copiedAccessRight.setParameters(newSiteNodeVersionId.toString());
InterceptionPoint icp = null;
for(InterceptionPoint currentICP : interceptionPointList)
{
if(currentICP.getId().equals(copiedAccessRight.getInterceptionPointId()))
icp = currentICP;
}
if(icp != null)
{
AccessRight newAccessRight = AccessRightController.getController().create(copiedAccessRight, icp, db);
Iterator groupsIterator = accessRight.getGroups().iterator();
while(groupsIterator.hasNext())
{
AccessRightGroup accessRightGroup = (AccessRightGroup)groupsIterator.next();
AccessRightGroupVO newAccessRightGroupVO = new AccessRightGroupVO();
newAccessRightGroupVO.setGroupName(accessRightGroup.getGroupName());
AccessRightGroup newAccessRightGroup = AccessRightController.getController().createAccessRightGroup(db, newAccessRightGroupVO, newAccessRight);
newAccessRight.getGroups().add(newAccessRightGroup);
}
Iterator rolesIterator = accessRight.getRoles().iterator();
while(rolesIterator.hasNext())
{
AccessRightRole accessRightRole = (AccessRightRole)rolesIterator.next();
AccessRightRoleVO newAccessRightRoleVO = new AccessRightRoleVO();
newAccessRightRoleVO.setRoleName(accessRightRole.getRoleName());
AccessRightRole newAccessRightRole = AccessRightController.getController().createAccessRightRole(db, newAccessRightRoleVO, newAccessRight);
newAccessRight.getRoles().add(newAccessRightRole);
}
Iterator usersIterator = accessRight.getUsers().iterator();
while(usersIterator.hasNext())
{
AccessRightUser accessRightUser = (AccessRightUser)usersIterator.next();
AccessRightUserVO newAccessRightUserVO = new AccessRightUserVO();
newAccessRightUserVO.setUserName(accessRightUser.getUserName());
AccessRightUser newAccessRightUser = AccessRightController.getController().createAccessRightUser(db, newAccessRightUserVO, newAccessRight);
newAccessRight.getUsers().add(newAccessRightUser);
}
}
}
}