Merge pull request #21478 from germanocaumo/bbb-breakout-room-permissions

feat: allow parent room moderators to kick other users in breakouts
This commit is contained in:
Anton Georgiev 2024-10-22 12:01:37 -04:00 committed by GitHub
commit 0cb406a846
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 29 additions and 8 deletions

View File

@ -63,13 +63,23 @@ object BreakoutRoomsUtil extends SystemConfiguration {
checksum(apiCall.concat(baseString).concat(sharedSecret)) checksum(apiCall.concat(baseString).concat(sharedSecret))
} }
def joinParams(username: String, userId: String, isBreakout: Boolean, breakoutMeetingId: String, def joinParams(
password: String): (collection.immutable.Map[String, String], collection.immutable.Map[String, String]) = { username: String,
userId: String,
isBreakout: Boolean,
breakoutMeetingId: String,
avatarURL: String,
role: String,
password: String
): (collection.immutable.Map[String, String], collection.immutable.Map[String, String]) = {
val moderator = role == "MODERATOR"
val params = collection.immutable.HashMap( val params = collection.immutable.HashMap(
"fullName" -> urlEncode(username), "fullName" -> urlEncode(username),
"userID" -> urlEncode(userId), "userID" -> urlEncode(userId),
"isBreakout" -> urlEncode(isBreakout.toString()), "isBreakout" -> urlEncode(isBreakout.toString()),
"meetingID" -> urlEncode(breakoutMeetingId), "meetingID" -> urlEncode(breakoutMeetingId),
"avatarURL" -> urlEncode(avatarURL),
"userdata-bbb_parent_room_moderator" -> urlEncode(moderator.toString()),
"password" -> urlEncode(password), "password" -> urlEncode(password),
"redirect" -> urlEncode("true") "redirect" -> urlEncode("true")
) )

View File

@ -41,8 +41,15 @@ object BreakoutHdlrHelpers extends SystemConfiguration {
for { for {
user <- Users2x.findWithIntId(liveMeeting.users2x, userId) user <- Users2x.findWithIntId(liveMeeting.users2x, userId)
apiCall = "join" apiCall = "join"
(redirectParams, redirectToHtml5Params) = BreakoutRoomsUtil.joinParams(user.name, userId + "-" + roomSequence, true, (redirectParams, redirectToHtml5Params) = BreakoutRoomsUtil.joinParams(
externalMeetingId, liveMeeting.props.password.moderatorPass) user.name,
userId + "-" + roomSequence,
true,
externalMeetingId,
user.avatar,
user.role,
liveMeeting.props.password.moderatorPass
)
// We generate a first url with redirect -> true // We generate a first url with redirect -> true
redirectBaseString = BreakoutRoomsUtil.createBaseString(redirectParams) redirectBaseString = BreakoutRoomsUtil.createBaseString(redirectParams)
redirectJoinURL = BreakoutRoomsUtil.createJoinURL(bbbWebAPI, apiCall, redirectBaseString, redirectJoinURL = BreakoutRoomsUtil.createJoinURL(bbbWebAPI, apiCall, redirectBaseString,

View File

@ -26,7 +26,7 @@ trait EjectUserFromMeetingCmdMsgHdlr extends RightsManagementTrait {
PermissionCheck.VIEWER_LEVEL, PermissionCheck.VIEWER_LEVEL,
liveMeeting.users2x, liveMeeting.users2x,
msg.header.userId msg.header.userId
) || liveMeeting.props.meetingProp.isBreakout) { )) {
val reason = "No permission to eject user from meeting." val reason = "No permission to eject user from meeting."
PermissionCheck.ejectUserForFailedPermission(meetingId, msg.header.userId, reason, outGW, liveMeeting) PermissionCheck.ejectUserForFailedPermission(meetingId, msg.header.userId, reason, outGW, liveMeeting)

View File

@ -6,6 +6,7 @@ import {
import Auth from '/imports/ui/services/auth'; import Auth from '/imports/ui/services/auth';
import logger from '/imports/startup/client/logger'; import logger from '/imports/startup/client/logger';
import { toggleMuteMicrophone } from '/imports/ui/components/audio/audio-graphql/audio-controls/input-stream-live-selector/service'; import { toggleMuteMicrophone } from '/imports/ui/components/audio/audio-graphql/audio-controls/input-stream-live-selector/service';
import getFromUserSettings from '/imports/ui/services/users-settings';
export const isVoiceOnlyUser = (userId: string) => userId.toString().startsWith('v_'); export const isVoiceOnlyUser = (userId: string) => userId.toString().startsWith('v_');
@ -25,6 +26,9 @@ export const generateActionsPermissions = (
const isDialInUser = isVoiceOnlyUser(subjectUser.userId); const isDialInUser = isVoiceOnlyUser(subjectUser.userId);
const amISubjectUser = isMe(subjectUser.userId); const amISubjectUser = isMe(subjectUser.userId);
const isSubjectUserModerator = subjectUser.isModerator; const isSubjectUserModerator = subjectUser.isModerator;
// Breakout rooms mess up with role permissions
// A breakout room user that has a moderator role in it's parent room
const parentRoomModerator = getFromUserSettings('bbb_parent_room_moderator', false);
const isSubjectUserGuest = subjectUser.guest; const isSubjectUserGuest = subjectUser.guest;
const hasAuthority = currentUser.isModerator || amISubjectUser; const hasAuthority = currentUser.isModerator || amISubjectUser;
const allowedToChatPrivately = !amISubjectUser && !isDialInUser; const allowedToChatPrivately = !amISubjectUser && !isDialInUser;
@ -42,7 +46,7 @@ export const generateActionsPermissions = (
// if currentUser is a moderator, allow removing other users // if currentUser is a moderator, allow removing other users
const allowedToRemove = amIModerator const allowedToRemove = amIModerator
&& !amISubjectUser && !amISubjectUser
&& !isBreakout; && (!isBreakout || parentRoomModerator);
const allowedToPromote = amIModerator const allowedToPromote = amIModerator
&& !amISubjectUser && !amISubjectUser

View File

@ -1398,8 +1398,8 @@ Useful tools for development:
| `userdata-bbb_skip_echotest_if_previous_device=` | (Introduced in BigBlueButton 3.0) If set to `true`, the user will not see the "echo test" if session has valid input/output devices stored previously | `false` | | `userdata-bbb_skip_echotest_if_previous_device=` | (Introduced in BigBlueButton 3.0) If set to `true`, the user will not see the "echo test" if session has valid input/output devices stored previously | `false` |
| `userdata-bbb_override_default_locale=` | (Introduced in BigBlueButton 2.3) If set to `de`, the user's browser preference will be ignored - the client will be shown in 'de' (i.e. German) regardless of the otherwise preferred locale 'en' (or other) | `null` | | `userdata-bbb_override_default_locale=` | (Introduced in BigBlueButton 2.3) If set to `de`, the user's browser preference will be ignored - the client will be shown in 'de' (i.e. German) regardless of the otherwise preferred locale 'en' (or other) | `null` |
| `userdata-bbb_hide_presentation_on_join` | (Introduced in BigBlueButton 2.6) If set to `true` it will make the user enter the meeting with presentation minimized (Only for non-presenters), not permanent. | `userdata-bbb_hide_presentation_on_join` | (Introduced in BigBlueButton 2.6) If set to `true` it will make the user enter the meeting with presentation minimized (Only for non-presenters), not permanent.
| `userdata-bbb_direct_leave_button` | (Introduced in BigBlueButton 2.7) If set to `true` it will make a button to leave the meeting appear to the left of the Options menu. | `false` |
| `userdata-bbb_direct_leave_button` | (Introduced in BigBlueButton 2.7) If set to `true` it will make a button to leave the meeting appear to the left of the Options menu. | `false` | | `false` | | `userdata-bbb_parent_room_moderator=` | (Introduced in BigBlueButton 3.0) Only used in breakouts: if set to `true`, user will have permission to kick other users inside the breakout | `false`
#### Branding parameters #### Branding parameters