}
List<AccessRight> accessRights = AccessRightController.getController().getAccessRightListOnlyReadOnly(interceptionPoint.getId(), oldParameter, db);
for(AccessRight accessRight : accessRights)
{
AccessRightImpl arImpl = new AccessRightImpl();
arImpl.setInterceptionPoint(interceptionPoint);
arImpl.setParameters(newParameter);
db.create(arImpl);
Iterator accessRightRoleIterator = accessRight.getRoles().iterator();
while(accessRightRoleIterator.hasNext())
{
AccessRightRole accessRightRole = (AccessRightRole)accessRightRoleIterator.next();
AccessRightRoleImpl arrImpl = new AccessRightRoleImpl();
arrImpl.setAccessRight(arImpl);
arrImpl.setRoleName(accessRightRole.getRoleName());
arImpl.getRoles().add(arrImpl);
db.create(arrImpl);
}
Iterator accessRightGroupIterator = accessRight.getGroups().iterator();
while(accessRightGroupIterator.hasNext())
{
AccessRightGroup accessRightGroup = (AccessRightGroup)accessRightGroupIterator.next();
AccessRightGroupImpl argImpl = new AccessRightGroupImpl();
argImpl.setAccessRight(arImpl);
argImpl.setGroupName(accessRightGroup.getGroupName());
arImpl.getGroups().add(argImpl);
db.create(argImpl);
}
Iterator accessRightUserIterator = accessRight.getUsers().iterator();
while(accessRightUserIterator.hasNext())
{
AccessRightUser accessRightUser = (AccessRightUser)accessRightUserIterator.next();
AccessRightUserImpl aruImpl = new AccessRightUserImpl();
aruImpl.setAccessRight(arImpl);
aruImpl.setUserName(accessRightUser.getUserName());
arImpl.getUsers().add(aruImpl);
db.create(aruImpl);
}
}
}