logger.info("parameters:" + parameters);
AccessRightVO accessRightVO = new AccessRightVO();
accessRightVO.setParameters("" + newContentVO.getId());
AccessRight accessRight = AccessRightController.getController().create(accessRightVO, interceptionPoint, db);
@SuppressWarnings("unchecked")
List<String> accessRightRoles = (List<String>)accessRightMap.get("accessRightRoles");
if(accessRightRoles != null)
{
Iterator<String> accessRightRolesIterator = accessRightRoles.iterator();
while(accessRightRolesIterator.hasNext())
{
//Map accessRightRoleMap = (Map)accessRightRolesIterator.next();
String roleName = accessRightRolesIterator.next();
AccessRightRoleVO accessRightRoleVO = new AccessRightRoleVO();
accessRightRoleVO.setRoleName(roleName);
AccessRightRole accessRightRole = AccessRightController.getController().createAccessRightRole(db, accessRightRoleVO, accessRight);
@SuppressWarnings("unchecked")
Collection<AccessRightRole> roles = accessRight.getRoles();
roles.add(accessRightRole);
}
}
@SuppressWarnings("unchecked")
List<String> accessRightGroups = (List<String>)accessRightMap.get("accessRightGroups");
if(accessRightGroups != null)
{
Iterator<String> accessRightGroupsIterator = accessRightGroups.iterator();
while(accessRightGroupsIterator.hasNext())
{
String groupName = accessRightGroupsIterator.next();
AccessRightGroupVO accessRightGroupVO = new AccessRightGroupVO();
accessRightGroupVO.setGroupName(groupName);
AccessRightGroup accessRightGroup = AccessRightController.getController().createAccessRightGroup(db, accessRightGroupVO, accessRight);
@SuppressWarnings("unchecked")
Collection<AccessRightGroup> groups = accessRight.getGroups();
groups.add(accessRightGroup);
}
}
@SuppressWarnings("unchecked")
List<String> accessRightUsers = (List<String>)accessRightMap.get("accessRightUsers");
if(accessRightUsers != null)
{
Iterator<String> accessRightUsersIterator = accessRightUsers.iterator();
while(accessRightUsersIterator.hasNext())
{
String userName = accessRightUsersIterator.next();
AccessRightUserVO accessRightUserVO = new AccessRightUserVO();
accessRightUserVO.setUserName(userName);
AccessRightUser accessRightUser = AccessRightController.getController().createAccessRightUser(db, accessRightUserVO, accessRight);
@SuppressWarnings("unchecked")
Collection<AccessRightUser> users = accessRight.getUsers();
users.add(accessRightUser);
}
}
commitTransaction(db);