only allow presenter to change slide

This commit is contained in:
Anton Georgiev 2017-08-10 10:59:03 -04:00
parent 0b8a8c856b
commit 0546afce1f
2 changed files with 12 additions and 2 deletions

View File

@ -2,6 +2,7 @@ package org.bigbluebutton.core.apps.presentation
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.running.OutMsgRouter
import org.bigbluebutton.core.models.Users2x
trait SetCurrentPagePubMsgHdlr {
this: PresentationApp2x =>
@ -23,8 +24,10 @@ trait SetCurrentPagePubMsgHdlr {
//record(event)
}
if (setCurrentPage(msg.body.presentationId, msg.body.pageId)) {
broadcastEvent(msg)
if (Users2x.isPresenter(msg.header.userId, liveMeeting.users2x)) {
if (setCurrentPage(msg.body.presentationId, msg.body.pageId)) {
broadcastEvent(msg)
}
}
}
}

View File

@ -92,6 +92,13 @@ object Users2x {
}
}
def isPresenter(intId: String, users: Users2x): Boolean = {
findWithIntId(users, intId) match {
case Some(u) => u.presenter
case None => false
}
}
def findPresenter(users: Users2x): Option[UserState] = {
users.toVector.find(u => u.presenter)
}