use of org.olat.course.groupsandrights.CourseGroupManager in project openolat by klemens.
the class PreviewConfigHelper method getPreviewCourseEnvironment.
public static CourseEnvironment getPreviewCourseEnvironment(boolean isCoach, boolean isCourseAdmin, ICourse course) {
// generateEnvironment();
final RepositoryEntry courseResource = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
final CourseGroupManager cgm = new PreviewCourseGroupManager(courseResource, new ArrayList<BusinessGroup>(), new ArrayList<BGArea>(), isCoach, isCourseAdmin);
final UserNodeAuditManager auditman = new PreviewAuditManager();
final AssessmentManager am = new PreviewAssessmentManager();
final CoursePropertyManager cpm = new PreviewCoursePropertyManager();
final Structure runStructure = course.getEditorTreeModel().createStructureForPreview();
final String title = course.getCourseTitle();
final CourseConfig courseConfig = course.getCourseEnvironment().getCourseConfig();
CourseEnvironment previewCourseEnvironment = new PreviewCourseEnvironment(title, runStructure, new Date(), course.getCourseFolderContainer(), course.getCourseBaseContainer(), course.getResourceableId(), cpm, cgm, auditman, am, courseConfig);
return previewCourseEnvironment;
}
use of org.olat.course.groupsandrights.CourseGroupManager in project openolat by klemens.
the class UserCourseEnvironmentImpl method isAdminOfAnyCourse.
@Override
public boolean isAdminOfAnyCourse() {
if (adminAnyCourse != null) {
return adminAnyCourse.booleanValue();
}
CourseGroupManager cgm = courseEnvironment.getCourseGroupManager();
boolean adminLazy = identityEnvironment.getRoles().isOLATAdmin() || identityEnvironment.getRoles().isInstitutionalResourceManager() || cgm.isIdentityAnyCourseAdministrator(identityEnvironment.getIdentity());
adminAnyCourse = new Boolean(adminLazy);
return adminLazy;
}
use of org.olat.course.groupsandrights.CourseGroupManager in project openolat by klemens.
the class UserCourseEnvironmentImpl method isCoachOfAnyCourse.
@Override
public boolean isCoachOfAnyCourse() {
if (coachAnyCourse != null) {
return coachAnyCourse.booleanValue();
}
CourseGroupManager cgm = courseEnvironment.getCourseGroupManager();
boolean coachLazy = cgm.isIdentityAnyCourseCoach(identityEnvironment.getIdentity());
coachAnyCourse = new Boolean(coachLazy);
return coachLazy;
}
use of org.olat.course.groupsandrights.CourseGroupManager in project openolat by klemens.
the class UserCourseEnvironmentImpl method isParticipantOfAnyCourse.
@Override
public boolean isParticipantOfAnyCourse() {
if (participantAnyCourse != null) {
return participantAnyCourse.booleanValue();
}
CourseGroupManager cgm = courseEnvironment.getCourseGroupManager();
boolean participantLazy = cgm.isIdentityAnyCourseParticipant(identityEnvironment.getIdentity());
participantAnyCourse = new Boolean(participantLazy);
return participantLazy;
}
Aggregations