-
Notifications
You must be signed in to change notification settings - Fork 5.9k
/
ChangeLockSettingsInMeetingCmdMsgHdlr.scala
executable file
·68 lines (59 loc) · 2.69 KB
/
ChangeLockSettingsInMeetingCmdMsgHdlr.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package org.bigbluebutton.core.apps.users
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.apps.{ PermissionCheck, RightsManagementTrait }
import org.bigbluebutton.core.running.OutMsgRouter
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core2.MeetingStatus2x
import org.bigbluebutton.core2.Permissions
trait ChangeLockSettingsInMeetingCmdMsgHdlr extends RightsManagementTrait {
this: MeetingActor =>
val outGW: OutMsgRouter
def handleSetLockSettings(msg: ChangeLockSettingsInMeetingCmdMsg): Unit = {
if (permissionFailed(PermissionCheck.MOD_LEVEL, PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, msg.header.userId)) {
val meetingId = liveMeeting.props.meetingProp.intId
val reason = "No permission to change lock settings"
PermissionCheck.ejectUserForFailedPermission(meetingId, msg.header.userId, reason, outGW, liveMeeting)
} else {
val settings = Permissions(
disableCam = msg.body.disableCam,
disableMic = msg.body.disableMic,
disablePrivChat = msg.body.disablePrivChat,
disablePubChat = msg.body.disablePubChat,
disableNote = msg.body.disableNote,
lockedLayout = msg.body.lockedLayout,
lockOnJoin = msg.body.lockOnJoin,
lockOnJoinConfigurable = msg.body.lockOnJoinConfigurable
)
if (!MeetingStatus2x.permissionsEqual(liveMeeting.status, settings) || !MeetingStatus2x.permisionsInitialized(liveMeeting.status)) {
MeetingStatus2x.initializePermissions(liveMeeting.status)
MeetingStatus2x.setPermissions(liveMeeting.status, settings)
val routing = Routing.addMsgToClientRouting(
MessageTypes.BROADCAST_TO_MEETING,
props.meetingProp.intId,
msg.body.setBy
)
val envelope = BbbCoreEnvelope(
LockSettingsInMeetingChangedEvtMsg.NAME,
routing
)
val body = LockSettingsInMeetingChangedEvtMsgBody(
disableCam = settings.disableCam,
disableMic = settings.disableMic,
disablePrivChat = settings.disablePrivChat,
disablePubChat = settings.disablePubChat,
disableNote = settings.disableNote,
lockedLayout = settings.lockedLayout,
lockOnJoin = settings.lockOnJoin,
lockOnJoinConfigurable = settings.lockOnJoinConfigurable,
msg.body.setBy
)
val header = BbbClientMsgHeader(
LockSettingsInMeetingChangedEvtMsg.NAME,
props.meetingProp.intId,
msg.body.setBy
)
outGW.send(BbbCommonEnvCoreMsg(envelope, LockSettingsInMeetingChangedEvtMsg(header, body)))
}
}
}
}