Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java,v diff -u -r1.201 -r1.202 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java 29 Oct 2014 11:58:11 -0000 1.201 +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java 29 Oct 2014 12:44:01 -0000 1.202 @@ -546,9 +546,12 @@ lessonService.setLearners(newLesson, organizationUsers); lessonService.setStaffMembers(newLesson, staffs); } else { - newLesson.setOrganisation(organisation); - // security check needs organisation to be set - securityService.isLessonMonitor(lessonId, userId, "create class for lesson", true); + if (organisation != null) { + // security check needs organisation to be set + // it is not set for lesson preview, so it still needs improvement + newLesson.setOrganisation(organisation); + securityService.isLessonMonitor(lessonId, userId, "create class for lesson", true); + } LessonClass oldLessonClass = newLesson.getLessonClass(); @@ -707,10 +710,12 @@ if (MonitoringService.log.isDebugEnabled()) { MonitoringService.log.debug("=============Starting Lesson " + lessonId + "=============="); } - securityService.isLessonMonitor(lessonId, userId, "start lesson", true); - // we get the lesson just created Lesson requestedLesson = lessonDAO.getLesson(new Long(lessonId)); + if (requestedLesson.getOrganisation() != null) { + // preview does not have organisation set, so this security check still needs improvement + securityService.isLessonMonitor(lessonId, userId, "start lesson", true); + } if (requestedLesson.isLessonStarted()) { MonitoringService.log .warn("Lesson "