// import groups
cgm.importCourseLearningGroups(courseExportData);
cgm.importCourseRightGroups(courseExportData);
// create security group
Manager securityManager = ManagerFactory.getManager();
SecurityGroup ownerGroup = securityManager.createAndPersistSecurityGroup();
// member of this group may modify member's membership
securityManager.createAndPersistPolicy(ownerGroup, Constants.PERMISSION_ACCESS, ownerGroup);
// members of this group are always authors also
securityManager.createAndPersistPolicy(ownerGroup, Constants.PERMISSION_HASROLE, Constants.ORESOURCE_AUTHOR);
securityManager.addIdentityToSecurityGroup(securityManager.findIdentityByName("administrator"), ownerGroup);
re.setOwnerGroup(ownerGroup);
// save the repository entry
rm.saveRepositoryEntry(re);
// Create course admin policy for owner group of repository entry
// -> All owners of repository entries are course admins
securityManager.createAndPersistPolicy(re.getOwnerGroup(), Constants.PERMISSION_ADMIN, re.getOlatResource());
// deploy any referenced repository entries of the editor structure. This will also
// include any references in the run structure, since any node in the runstructure is also
// present in the editor structure.
deployReferencedRepositoryEntries(courseExportData, course,