accessRight = create(accessRightVO, interceptionPoint, db);
}
AccessRightRoleVO accessRightRoleVO = new AccessRightRoleVO();
accessRightRoleVO.setRoleName(roleName);
AccessRightRole accessRightRole = createAccessRightRole(db, accessRightRoleVO, accessRight);
accessRight.getRoles().add(accessRightRole);
accessRights++;
}
roleIndex++;
roleName = request.getParameter(interceptionPointIdString + "_" + roleIndex + "_roleName");
}
int groupIndex = 0;
String groupName = request.getParameter(interceptionPointIdString + "_" + groupIndex + "_groupName");
while(groupName != null)
{
logger.info("groupName:" + groupName);
if(accessRight == null)
{
InterceptionPoint interceptionPoint = InterceptionPointController.getController().getInterceptionPointWithId(new Integer(interceptionPointIdString), db);
//logger.info("Creating access for:" + interceptionPoint.getName() + "_" + parameters);
accessRight = create(accessRightVO, interceptionPoint, db);
}
AccessRightGroupVO accessRightGroupVO = new AccessRightGroupVO();
accessRightGroupVO.setGroupName(groupName);
AccessRightGroup accessRightGroup = createAccessRightGroup(db, accessRightGroupVO, accessRight);
accessRight.getGroups().add(accessRightGroup);
accessRights++;
groupIndex++;
groupName = request.getParameter(interceptionPointIdString + "_" + groupIndex + "_groupName");
//logger.info("groupName:" + groupName);
}
}
else
{
logger.info("accessRight after delete:" + accessRight.getAccessRightId());
int roleIndex = 0;
String roleName = request.getParameter(interceptionPointIdString + "_" + roleIndex + "_roleName");
while(roleName != null)
{
String hasAccess = request.getParameter(interceptionPointIdString + "_" + roleName + "_hasAccess");
if(hasAccess != null)
{
AccessRightRoleVO accessRightRoleVO = new AccessRightRoleVO();
accessRightRoleVO.setRoleName(roleName);
AccessRightRole accessRightRole = createAccessRightRole(db, accessRightRoleVO, accessRight);
accessRight.getRoles().add(accessRightRole);
accessRights++;
}
roleIndex++;