final Structure runStructure = course.getEditorTreeModel().createStructureForPreview();
final String title = course.getCourseTitle();
simCourseEnv = new PreviewCourseEnvironment(title, runStructure, psf.getDate(), course.getCourseFolderContainer(), course
.getCourseBaseContainer(),course.getResourceableId(), cpm, cgm, auditman, am);
simIdentEnv = new IdentityEnvironment();
simIdentEnv.setRoles(new Roles(false, false, false, isGlobalAuthor, isGuestOnly, false));
final Identity ident = new PreviewIdentity();
simIdentEnv.setIdentity(ident);
//identity must be set before attributes OLAT-4811
simIdentEnv.setAttributes(psf.getAttributesMap());