From 0546afce1ffa8e0276cd5cf22e0c06578383cd46 Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Thu, 10 Aug 2017 10:59:03 -0400 Subject: [PATCH] only allow presenter to change slide --- .../core/apps/presentation/SetCurrentPagePubMsgHdlr.scala | 7 +++++-- .../main/scala/org/bigbluebutton/core/models/Users2x.scala | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/SetCurrentPagePubMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/SetCurrentPagePubMsgHdlr.scala index 0e7861ceb3..58e84a65bd 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/SetCurrentPagePubMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/SetCurrentPagePubMsgHdlr.scala @@ -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) + } } } } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/Users2x.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/Users2x.scala index 78c4848169..c5c118e973 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/Users2x.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/Users2x.scala @@ -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) }