Search in sources :

Example 1 with OpenMeetingsRunController

use of org.olat.modules.openmeetings.ui.OpenMeetingsRunController in project OpenOLAT by OpenOLAT.

the class OpenMeetingsCourseNode method createNodeRunConstructionResult.

@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    Roles roles = ureq.getUserSession().getRoles();
    // check if user is moderator of the virtual classroom
    boolean admin = roles.isOLATAdmin();
    boolean moderator = admin;
    RepositoryEntry re = userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
    if (!admin) {
        RepositoryManager rm = RepositoryManager.getInstance();
        if (re != null) {
            admin = rm.isOwnerOfRepositoryEntry(ureq.getIdentity(), re) || rm.isInstitutionalRessourceManagerFor(ureq.getIdentity(), roles, re);
            moderator = admin || rm.isIdentityInTutorSecurityGroup(ureq.getIdentity(), re) || isCoach(re, ureq.getIdentity());
        }
    }
    // create run controller
    OLATResourceable ores = OresHelper.clone(userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseResource());
    Controller runCtr = new OpenMeetingsRunController(ureq, wControl, null, ores, getIdent(), admin, moderator, userCourseEnv.isCourseReadOnly());
    Controller controller = TitledWrapperHelper.getWrapper(ureq, wControl, runCtr, this, "o_openmeetings_icon");
    return new NodeRunConstructionResult(controller);
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) OpenMeetingsRunController(org.olat.modules.openmeetings.ui.OpenMeetingsRunController) Roles(org.olat.core.id.Roles) RepositoryManager(org.olat.repository.RepositoryManager) RepositoryEntry(org.olat.repository.RepositoryEntry) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) OpenMeetingsEditController(org.olat.course.nodes.openmeetings.OpenMeetingsEditController) OpenMeetingsPeekViewController(org.olat.course.nodes.openmeetings.OpenMeetingsPeekViewController) OpenMeetingsRunController(org.olat.modules.openmeetings.ui.OpenMeetingsRunController) CPEditController(org.olat.course.nodes.cp.CPEditController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) OpenMeetingsRoomEditController(org.olat.modules.openmeetings.ui.OpenMeetingsRoomEditController) ConditionEditController(org.olat.course.condition.ConditionEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 2 with OpenMeetingsRunController

use of org.olat.modules.openmeetings.ui.OpenMeetingsRunController in project openolat by klemens.

the class OpenMeetingsCourseNode method createNodeRunConstructionResult.

@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    Roles roles = ureq.getUserSession().getRoles();
    // check if user is moderator of the virtual classroom
    boolean admin = roles.isOLATAdmin();
    boolean moderator = admin;
    RepositoryEntry re = userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
    if (!admin) {
        RepositoryManager rm = RepositoryManager.getInstance();
        if (re != null) {
            admin = rm.isOwnerOfRepositoryEntry(ureq.getIdentity(), re) || rm.isInstitutionalRessourceManagerFor(ureq.getIdentity(), roles, re);
            moderator = admin || rm.isIdentityInTutorSecurityGroup(ureq.getIdentity(), re) || isCoach(re, ureq.getIdentity());
        }
    }
    // create run controller
    OLATResourceable ores = OresHelper.clone(userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseResource());
    Controller runCtr = new OpenMeetingsRunController(ureq, wControl, null, ores, getIdent(), admin, moderator, userCourseEnv.isCourseReadOnly());
    Controller controller = TitledWrapperHelper.getWrapper(ureq, wControl, runCtr, this, "o_openmeetings_icon");
    return new NodeRunConstructionResult(controller);
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) OpenMeetingsRunController(org.olat.modules.openmeetings.ui.OpenMeetingsRunController) Roles(org.olat.core.id.Roles) RepositoryManager(org.olat.repository.RepositoryManager) RepositoryEntry(org.olat.repository.RepositoryEntry) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) OpenMeetingsEditController(org.olat.course.nodes.openmeetings.OpenMeetingsEditController) OpenMeetingsPeekViewController(org.olat.course.nodes.openmeetings.OpenMeetingsPeekViewController) OpenMeetingsRunController(org.olat.modules.openmeetings.ui.OpenMeetingsRunController) CPEditController(org.olat.course.nodes.cp.CPEditController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) OpenMeetingsRoomEditController(org.olat.modules.openmeetings.ui.OpenMeetingsRoomEditController) ConditionEditController(org.olat.course.condition.ConditionEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Aggregations

Controller (org.olat.core.gui.control.Controller)2 TabbableController (org.olat.core.gui.control.generic.tabbable.TabbableController)2 OLATResourceable (org.olat.core.id.OLATResourceable)2 Roles (org.olat.core.id.Roles)2 ConditionEditController (org.olat.course.condition.ConditionEditController)2 NodeEditController (org.olat.course.editor.NodeEditController)2 CPEditController (org.olat.course.nodes.cp.CPEditController)2 OpenMeetingsEditController (org.olat.course.nodes.openmeetings.OpenMeetingsEditController)2 OpenMeetingsPeekViewController (org.olat.course.nodes.openmeetings.OpenMeetingsPeekViewController)2 NodeRunConstructionResult (org.olat.course.run.navigation.NodeRunConstructionResult)2 OpenMeetingsRoomEditController (org.olat.modules.openmeetings.ui.OpenMeetingsRoomEditController)2 OpenMeetingsRunController (org.olat.modules.openmeetings.ui.OpenMeetingsRunController)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2 RepositoryManager (org.olat.repository.RepositoryManager)2