From 313440abdd74fefe4d0ba506fce0442e07da3962 Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Tue, 17 Oct 2017 15:01:10 -0700 Subject: [PATCH] - send an eject message to the client so client doesn't attempt to auto-reconnect --- .../bigbluebutton/core/apps/PermisssionCheck.scala | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala index baa7c116c8..dbcd356527 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala @@ -44,16 +44,26 @@ object PermisssionCheck { val permLevelCheck = permissionToLevel(user) >= permissionLevel println("roleToLevel = " + roleToLevel(user) + " roleLevel=" + roleLevel) val roleLevelCheck = roleToLevel(user) >= roleLevel - println("PERMLEVELCHECK = " + permissionToLevel(user) + " ROLELEVELCHECK=" + permissionLevel) println("PERMLEVELCHECK = " + permLevelCheck + " ROLELEVELCHECK=" + roleLevelCheck) permLevelCheck && roleLevelCheck + false case None => false } } + private def sendEjectMessageToClient(meetingId: String, userId: String, + outGW: OutMsgRouter, ejectedBy: String): Unit = { + val ejectFromMeetingClientEvent = MsgBuilder.buildUserEjectedFromMeetingEvtMsg( + meetingId, userId, ejectedBy + ) + outGW.send(ejectFromMeetingClientEvent) + } + def ejectUserForFailedPermission(meetingId: String, userId: String, reason: String, outGW: OutMsgRouter): Unit = { + sendEjectMessageToClient(meetingId, userId, outGW, "SYSTEM") + // send a system message to force disconnection val ejectFromMeetingSystemEvent = MsgBuilder.buildDisconnectClientSysMsg(meetingId, userId, reason) outGW.send(ejectFromMeetingSystemEvent)