From c8e2d8b239b51c0054a863cf39b55d7b1e63a9e1 Mon Sep 17 00:00:00 2001 From: Dennis Benz Date: Sun, 2 Jun 2024 15:01:15 +0200 Subject: [PATCH] Resolve conflicts --- .../apps/users/ChangeUserRoleCmdMsgHdlr.scala | 2 +- .../core/db/MeetingUsersPoliciesDAO.scala | 7 ++-- .../bigbluebutton/core/AppsTestFixtures.scala | 3 +- .../common2/domain/Meeting2x.scala | 21 ++++++------ .../bigbluebutton/common2/TestFixtures.scala | 3 +- .../java/org/bigbluebutton/api/ApiParams.java | 1 + .../org/bigbluebutton/api/MeetingService.java | 5 ++- .../api/ParamsProcessorUtil.java | 14 +++++++- .../org/bigbluebutton/api/domain/Meeting.java | 34 ++++++++++++++----- .../bigbluebutton/api2/IBbbWebApiGWApp.java | 12 +++---- .../bigbluebutton/api2/domain/UsersProp2.java | 3 ++ .../bigbluebutton/api2/BbbWebApiGWApp.scala | 3 +- bbb-graphql-server/bbb_schema.sql | 22 ++++++------ .../public_v_meeting_usersPolicies.yaml | 1 + .../imports/ui/Types/meeting.ts | 1 + .../user-list-participants/queries.ts | 1 + .../user-actions/service.ts | 4 +-- .../grails-app/conf/bigbluebutton.properties | 3 ++ .../grails-app/conf/spring/resources.xml | 1 + 19 files changed, 92 insertions(+), 49 deletions(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeUserRoleCmdMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeUserRoleCmdMsgHdlr.scala index d6a91eacdb..d62b92a7ec 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeUserRoleCmdMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeUserRoleCmdMsgHdlr.scala @@ -31,7 +31,7 @@ trait ChangeUserRoleCmdMsgHdlr extends RightsManagementTrait { } yield { RegisteredUsers.updateUserRole(liveMeeting.registeredUsers, u, userRole) } - val promoteGuest = !liveMeeting.props.usersProp.authenticatedGuest + val promoteGuest = !liveMeeting.props.usersProp.authenticatedGuest || liveMeeting.props.usersProp.allowPromoteGuestToModerator if (msg.body.role == Roles.MODERATOR_ROLE && (!uvo.guest || promoteGuest)) { // Promote non-guest users. val notifyEvent = MsgBuilder.buildNotifyUserInMeetingEvtMsg( diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/MeetingUsersPoliciesDAO.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/MeetingUsersPoliciesDAO.scala index 37cebe5598..cbfab07a53 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/MeetingUsersPoliciesDAO.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/MeetingUsersPoliciesDAO.scala @@ -19,7 +19,8 @@ case class MeetingUsersPoliciesDbModel( meetingLayout: String, allowModsToUnmuteUsers: Boolean, allowModsToEjectCameras: Boolean, - authenticatedGuest: Boolean + authenticatedGuest: Boolean, + allowPromoteGuestToModerator: Boolean ) class MeetingUsersPoliciesDbTableDef(tag: Tag) extends Table[MeetingUsersPoliciesDbModel](tag, "meeting_usersPolicies") { @@ -34,10 +35,11 @@ class MeetingUsersPoliciesDbTableDef(tag: Tag) extends Table[MeetingUsersPolicie val allowModsToUnmuteUsers = column[Boolean]("allowModsToUnmuteUsers") val allowModsToEjectCameras = column[Boolean]("allowModsToEjectCameras") val authenticatedGuest = column[Boolean]("authenticatedGuest") + val allowPromoteGuestToModerator = column[Boolean]("allowPromoteGuestToModerator") // val fk_meetingId: ForeignKeyQuery[MeetingDbTableDef, MeetingDbModel] = foreignKey("fk_meetingId", meetingId, TableQuery[MeetingDbTableDef])(_.meetingId) - override val * : ProvenShape[MeetingUsersPoliciesDbModel] = (meetingId, maxUsers, maxUserConcurrentAccesses, webcamsOnlyForModerator, userCameraCap, guestPolicy, guestLobbyMessage, meetingLayout, allowModsToUnmuteUsers, allowModsToEjectCameras, authenticatedGuest) <> (MeetingUsersPoliciesDbModel.tupled, MeetingUsersPoliciesDbModel.unapply) + override val * : ProvenShape[MeetingUsersPoliciesDbModel] = (meetingId, maxUsers, maxUserConcurrentAccesses, webcamsOnlyForModerator, userCameraCap, guestPolicy, guestLobbyMessage, meetingLayout, allowModsToUnmuteUsers, allowModsToEjectCameras, authenticatedGuest, allowPromoteGuestToModerator) <> (MeetingUsersPoliciesDbModel.tupled, MeetingUsersPoliciesDbModel.unapply) } object MeetingUsersPoliciesDAO { @@ -56,6 +58,7 @@ object MeetingUsersPoliciesDAO { allowModsToUnmuteUsers = usersProp.allowModsToUnmuteUsers, allowModsToEjectCameras = usersProp.allowModsToEjectCameras, authenticatedGuest = usersProp.authenticatedGuest, + allowPromoteGuestToModerator = usersProp.allowPromoteGuestToModerator, ) ) ).onComplete { diff --git a/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/AppsTestFixtures.scala b/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/AppsTestFixtures.scala index 5f9cf5d6fb..b89b956b4a 100755 --- a/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/AppsTestFixtures.scala +++ b/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/AppsTestFixtures.scala @@ -44,6 +44,7 @@ trait AppsTestFixtures { val allowModsToUnmuteUsers = false val allowModsToEjectCameras = false val authenticatedGuest = false + val allowPromoteGuestToModerator = false val meetingLayout = "" val captureNotesFilename = s"Room 0${sequence} (Notes)" val captureSlidesFilename = s"Room 0${sequence} (Whiteboard)" @@ -69,7 +70,7 @@ trait AppsTestFixtures { val usersProp = UsersProp(maxUsers = maxUsers, webcamsOnlyForModerator = webcamsOnlyForModerator, userCameraCap = userCameraCap, guestPolicy = guestPolicy, allowModsToUnmuteUsers = allowModsToUnmuteUsers, allowModsToEjectCameras = allowModsToEjectCameras, - authenticatedGuest = authenticatedGuest, meetingLayout = meetingLayout) + authenticatedGuest = authenticatedGuest, allowPromoteGuestToModerator = allowPromoteGuestToModerator, meetingLayout = meetingLayout) val metadataProp = new MetadataProp(metadata) val defaultProps = DefaultProps(meetingProp, breakoutProps, durationProps, password, recordProp, welcomeProp, voiceProp, diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scala index dd988df254..2f90d1af10 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scala @@ -41,16 +41,17 @@ case class WelcomeProp(welcomeMsg: String, welcomeMsgForModerators: String) case class VoiceProp(telVoice: String, voiceConf: String, dialNumber: String, muteOnStart: Boolean) case class UsersProp( - maxUsers: Int, - maxUserConcurrentAccesses:Int, - webcamsOnlyForModerator: Boolean, - userCameraCap: Int, - guestPolicy: String, - meetingLayout: String, - allowModsToUnmuteUsers: Boolean, - allowModsToEjectCameras: Boolean, - authenticatedGuest: Boolean, - waitingGuestUsersTimeout: Long, + maxUsers: Int, + maxUserConcurrentAccesses: Int, + webcamsOnlyForModerator: Boolean, + userCameraCap: Int, + guestPolicy: String, + meetingLayout: String, + allowModsToUnmuteUsers: Boolean, + allowModsToEjectCameras: Boolean, + authenticatedGuest: Boolean, + allowPromoteGuestToModerator: Boolean, + waitingGuestUsersTimeout: Long ) case class MetadataProp(metadata: collection.immutable.Map[String, String]) diff --git a/bbb-common-message/src/test/scala/org/bigbluebutton/common2/TestFixtures.scala b/bbb-common-message/src/test/scala/org/bigbluebutton/common2/TestFixtures.scala index 88cc48c925..0cddb749dd 100755 --- a/bbb-common-message/src/test/scala/org/bigbluebutton/common2/TestFixtures.scala +++ b/bbb-common-message/src/test/scala/org/bigbluebutton/common2/TestFixtures.scala @@ -44,6 +44,7 @@ trait TestFixtures { val keepEvents = false val guestPolicy = "ALWAYS_ASK" val authenticatedGuest = false + val allowPromoteGuestToModerator = false val metadata: collection.immutable.Map[String, String] = Map("foo" -> "bar", "bar" -> "baz", "baz" -> "foo") val captureNotesFilename = s"Room 0${sequence} (Notes)" val captureSlidesFilename = s"Room 0${sequence} (Whiteboard)" @@ -71,7 +72,7 @@ trait TestFixtures { val voiceProp = VoiceProp(telVoice = voiceConfId, voiceConf = voiceConfId, dialNumber = dialNumber, muteOnStart = muteOnStart) val usersProp = UsersProp(maxUsers = maxUsers, webcamsOnlyForModerator = webcamsOnlyForModerator, userCameraCap = userCameraCap, - guestPolicy = guestPolicy, allowModsToUnmuteUsers = allowModsToUnmuteUsers, allowModsToEjectCameras = allowModsToEjectCameras, authenticatedGuest = authenticatedGuest) + guestPolicy = guestPolicy, allowModsToUnmuteUsers = allowModsToUnmuteUsers, allowModsToEjectCameras = allowModsToEjectCameras, authenticatedGuest = authenticatedGuest, allowPromoteGuestToModerator = allowPromoteGuestToModerator) val metadataProp = new MetadataProp(metadata) val defaultProps = DefaultProps(meetingProp, breakoutProps, durationProps, password, recordProp, welcomeProp, voiceProp, usersProp, metadataProp) diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/ApiParams.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/ApiParams.java index 098bd4f2bc..0c51f71846 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/ApiParams.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/ApiParams.java @@ -33,6 +33,7 @@ public class ApiParams { public static final String FREE_JOIN = "freeJoin"; public static final String FULL_NAME = "fullName"; public static final String GUEST_POLICY = "guestPolicy"; + public static final String ALLOW_PROMOTE_GUEST_TO_MODERATOR = "allowPromoteGuestToModerator"; public static final String MEETING_LAYOUT = "meetingLayout"; public static final String IS_BREAKOUT = "isBreakout"; public static final String LOGO = "logo"; diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java index 035ceba5c8..6992394e69 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java @@ -423,9 +423,8 @@ public class MeetingService implements MessageListener { m.getWebcamsOnlyForModerator(), m.getMeetingCameraCap(), m.getUserCameraCap(), m.getMaxPinnedCameras(), m.getModeratorPassword(), m.getViewerPassword(), m.getLearningDashboardAccessToken(), m.getCreateTime(), formatPrettyDate(m.getCreateTime()), m.isBreakout(), m.getSequence(), m.isFreeJoin(), m.getMetadata(), - m.getGuestPolicy(), m.getAuthenticatedGuest(), m.getWaitingGuestUsersTimeout(), m.getMeetingLayout(), - m.getWelcomeMessageTemplate(), m.getWelcomeMessage(), m.getWelcomeMsgForModerators(), - m.getDialNumber(), m.getMaxUsers(), m.getMaxUserConcurrentAccesses(), + m.getGuestPolicy(), m.getAuthenticatedGuest(), m.getAllowPromoteGuestToModerator(), m.getWaitingGuestUsersTimeout(), m.getMeetingLayout(), m.getWelcomeMessageTemplate(), m.getWelcomeMessage(), + m.getWelcomeMsgForModerators(), m.getDialNumber(), m.getMaxUsers(), m.getMaxUserConcurrentAccesses(), m.getMeetingExpireIfNoUserJoinedInMinutes(), m.getMeetingExpireWhenLastUserLeftInMinutes(), m.getUserInactivityInspectTimerInMinutes(), m.getUserInactivityThresholdInMinutes(), m.getUserActivitySignResponseDelayInMinutes(), m.getEndWhenNoModerator(), m.getEndWhenNoModeratorDelayInMinutes(), diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java index dc5c758bb5..2cb31c43f3 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java @@ -77,12 +77,14 @@ public class ParamsProcessorUtil { private String defaultHTML5ClientUrl; private String graphqlWebsocketUrl; + private String defaultGuestWaitURL; private Boolean allowRequestsWithoutSession = false; private Integer defaultHttpSessionTimeout = 14400; private Boolean useDefaultAvatar = false; private String defaultAvatarURL; private String defaultGuestPolicy; private Boolean authenticatedGuest; + private Boolean defaultAllowPromoteGuestToModerator; private Long waitingGuestUsersTimeout; private String defaultMeetingLayout; private int defaultMeetingDuration; @@ -678,6 +680,11 @@ public class ParamsProcessorUtil { guestPolicy = params.get(ApiParams.GUEST_POLICY); } + Boolean allowPromoteGuestToModerator = defaultAllowPromoteGuestToModerator; + if (!StringUtils.isEmpty(params.get(ApiParams.ALLOW_PROMOTE_GUEST_TO_MODERATOR))) { + allowPromoteGuestToModerator = Boolean.parseBoolean(params.get(ApiParams.ALLOW_PROMOTE_GUEST_TO_MODERATOR)); + } + String presentationUploadExternalDescription = defaultPresentationUploadExternalDescription; if (!StringUtils.isEmpty(params.get(ApiParams.PRESENTATION_UPLOAD_EXTERNAL_DESCRIPTION))) { presentationUploadExternalDescription = params.get(ApiParams.PRESENTATION_UPLOAD_EXTERNAL_DESCRIPTION); @@ -767,6 +774,7 @@ public class ParamsProcessorUtil { .withIsBreakout(isBreakout) .withGuestPolicy(guestPolicy) .withAuthenticatedGuest(authenticatedGuest) + .withAllowPromoteGuestToModerator(allowPromoteGuestToModerator) .withWaitingGuestUsersTimeout(waitingGuestUsersTimeout) .withAllowRequestsWithoutSession(allowRequestsWithoutSession) .withMeetingLayout(meetingLayout) @@ -1302,7 +1310,7 @@ public class ParamsProcessorUtil { this.useDefaultAvatar = value; } - public void setdefaultAvatarURL(String url) { + public void setDefaultAvatarURL(String url) { this.defaultAvatarURL = url; } @@ -1314,6 +1322,10 @@ public class ParamsProcessorUtil { this.authenticatedGuest = value; } + public void setDefaultAllowPromoteGuestToModerator(Boolean value) { + this.defaultAllowPromoteGuestToModerator = value; + } + public void setWaitingGuestUsersTimeout(Long value) { this.waitingGuestUsersTimeout = value; } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java index 1da16bf26e..ef6ef73175 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java @@ -81,6 +81,7 @@ public class Meeting { private String guestLobbyMessage = ""; private Map usersWithGuestLobbyMessages; private Boolean authenticatedGuest = false; + private Boolean allowPromoteGuestToModerator = false; private long waitingGuestUsersTimeout = 30000; private String meetingLayout = MeetingLayout.SMART_LAYOUT; private boolean userHasJoined = false; @@ -166,8 +167,9 @@ public class Meeting { isBreakout = builder.isBreakout; guestPolicy = builder.guestPolicy; authenticatedGuest = builder.authenticatedGuest; - waitingGuestUsersTimeout = builder.waitingGuestUsersTimeout; - meetingLayout = builder.meetingLayout; + allowPromoteGuestToModerator = builder.allowPromoteGuestToModerator; + waitingGuestUsersTimeout = builder.waitingGuestUsersTimeout; + meetingLayout = builder.meetingLayout; allowRequestsWithoutSession = builder.allowRequestsWithoutSession; breakoutRoomsParams = builder.breakoutRoomsParams; lockSettingsParams = builder.lockSettingsParams; @@ -503,14 +505,22 @@ public class Meeting { return authenticatedGuest; } - public void setWaitingGuestUsersTimeout(long waitingGuestUsersTimeout) { - waitingGuestUsersTimeout = waitingGuestUsersTimeout; + public void setAllowPromoteGuestToModerator(Boolean value) { + allowPromoteGuestToModerator = value; } - public long getWaitingGuestUsersTimeout() { - return waitingGuestUsersTimeout; + public Boolean getAllowPromoteGuestToModerator() { + return allowPromoteGuestToModerator; } + public void setWaitingGuestUsersTimeout(long waitingGuestUsersTimeout) { + waitingGuestUsersTimeout = waitingGuestUsersTimeout; + } + + public long getWaitingGuestUsersTimeout() { + return waitingGuestUsersTimeout; + } + public void setMeetingLayout(String layout) { meetingLayout = layout; } @@ -920,7 +930,8 @@ public class Meeting { private boolean isBreakout; private String guestPolicy; private Boolean authenticatedGuest; - private long waitingGuestUsersTimeout; + private Boolean allowPromoteGuestToModerator; + private long waitingGuestUsersTimeout; private Boolean allowRequestsWithoutSession; private String meetingLayout; private BreakoutRoomsParams breakoutRoomsParams; @@ -1107,8 +1118,13 @@ public class Meeting { return this; } - public Builder withWaitingGuestUsersTimeout(long waitingGuestUsersTimeout) { - this.waitingGuestUsersTimeout = waitingGuestUsersTimeout; + public Builder withAllowPromoteGuestToModerator(Boolean value) { + allowPromoteGuestToModerator = value; + return this; + } + + public Builder withWaitingGuestUsersTimeout(long value) { + waitingGuestUsersTimeout = value; return this; } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java b/bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java index 582a09f3ba..ded0b59120 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java @@ -16,14 +16,9 @@ import org.bigbluebutton.presentation.messages.IDocConversionMsg; public interface IBbbWebApiGWApp { void send(String channel, String message); - void createMeeting(String meetingID, - String externalMeetingID, - String parentMeetingID, - String meetingName, - Boolean recorded, - String voiceBridge, - Integer duration, - Boolean autoStartRecording, + void createMeeting(String meetingID, String externalMeetingID, + String parentMeetingID, String meetingName, Boolean recorded, + String voiceBridge, Integer duration, Boolean autoStartRecording, Boolean allowStartStopRecording, Boolean recordFullDurationMedia, Boolean webcamsOnlyForModerator, @@ -41,6 +36,7 @@ public interface IBbbWebApiGWApp { Map metadata, String guestPolicy, Boolean authenticatedGuest, + Boolean allowPromoteGuestToModerator, Long waitingGuestUsersTimeout, String meetingLayout, String welcomeMsgTemplate, diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api2/domain/UsersProp2.java b/bbb-common-web/src/main/java/org/bigbluebutton/api2/domain/UsersProp2.java index 28b94a1b70..4304832f0c 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api2/domain/UsersProp2.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api2/domain/UsersProp2.java @@ -7,6 +7,7 @@ public class UsersProp2 { public final String guestPolicy; public final String meetingLayout; public final boolean authenticatedGuest; + public final boolean allowPromoteGuestToModerator; public final boolean userHasJoined; public final boolean webcamsOnlyForModerator; public final int userCameraCap; @@ -21,6 +22,7 @@ public class UsersProp2 { String guestPolicy, String meetingLayout, boolean authenticatedGuest, + boolean allowPromoteGuestToModerator, boolean userHasJoined, Map userCustomData, Map users, @@ -31,6 +33,7 @@ public class UsersProp2 { this.guestPolicy = guestPolicy; this.meetingLayout = meetingLayout; this.authenticatedGuest = authenticatedGuest; + this.allowPromoteGuestToModerator = allowPromoteGuestToModerator; this.userHasJoined = userHasJoined; this.userCustomData = userCustomData; this.users = users; diff --git a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala index 59866742d8..ad76462393 100755 --- a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala +++ b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala @@ -6,7 +6,6 @@ import org.apache.pekko.event.Logging import org.bigbluebutton.api.domain.{BreakoutRoomsParams, Group, LockSettingsParams} import org.bigbluebutton.api.messaging.converters.messages._ import org.bigbluebutton.api.messaging.messages.ChatMessageFromApi -import org.bigbluebutton.api.model.request.SendChatMessage import org.bigbluebutton.api2.bus._ import org.bigbluebutton.api2.endpoint.redis.WebRedisSubscriberActor import org.bigbluebutton.common2.redis.MessageSender @@ -135,6 +134,7 @@ class BbbWebApiGWApp( metadata: java.util.Map[String, String], guestPolicy: String, authenticatedGuest: java.lang.Boolean, + allowPromoteGuestToModerator: java.lang.Boolean, waitingGuestUsersTimeout: java.lang.Long, meetingLayout: String, welcomeMsgTemplate: String, welcomeMsg: String, welcomeMsgForModerators: String, @@ -222,6 +222,7 @@ class BbbWebApiGWApp( guestPolicy = guestPolicy, meetingLayout = meetingLayout, allowModsToUnmuteUsers = allowModsToUnmuteUsers.booleanValue(), allowModsToEjectCameras = allowModsToEjectCameras.booleanValue(), authenticatedGuest = authenticatedGuest.booleanValue(), + allowPromoteGuestToModerator = allowPromoteGuestToModerator.booleanValue(), waitingGuestUsersTimeout = waitingGuestUsersTimeout.longValue() ) val metadataProp = MetadataProp(mapAsScalaMap(metadata).toMap) diff --git a/bbb-graphql-server/bbb_schema.sql b/bbb-graphql-server/bbb_schema.sql index 75b23f9763..bbcd6d1576 100644 --- a/bbb-graphql-server/bbb_schema.sql +++ b/bbb-graphql-server/bbb_schema.sql @@ -127,16 +127,17 @@ create view "v_meeting_voiceSettings" as select * from meeting_voice; create table "meeting_usersPolicies" ( "meetingId" varchar(100) primary key references "meeting"("meetingId") ON DELETE CASCADE, - "maxUsers" integer, - "maxUserConcurrentAccesses" integer, - "webcamsOnlyForModerator" boolean, - "userCameraCap" integer, - "guestPolicy" varchar(100), - "guestLobbyMessage" text, - "meetingLayout" varchar(100), - "allowModsToUnmuteUsers" boolean, - "allowModsToEjectCameras" boolean, - "authenticatedGuest" boolean + "maxUsers" integer, + "maxUserConcurrentAccesses" integer, + "webcamsOnlyForModerator" boolean, + "userCameraCap" integer, + "guestPolicy" varchar(100), + "guestLobbyMessage" text, + "meetingLayout" varchar(100), + "allowModsToUnmuteUsers" boolean, + "allowModsToEjectCameras" boolean, + "authenticatedGuest" boolean, + "allowPromoteGuestToModerator" boolean ); create index "idx_meeting_usersPolicies_meetingId" on "meeting_usersPolicies"("meetingId"); @@ -152,6 +153,7 @@ SELECT "meeting_usersPolicies"."meetingId", "meeting_usersPolicies"."allowModsToUnmuteUsers", "meeting_usersPolicies"."allowModsToEjectCameras", "meeting_usersPolicies"."authenticatedGuest", + "meeting_usersPolicies"."allowPromoteGuestToModerator", "meeting"."isBreakout" is false "moderatorsCanMuteAudio", "meeting"."isBreakout" is false and "meeting_usersPolicies"."allowModsToUnmuteUsers" is true "moderatorsCanUnmuteAudio" FROM "meeting_usersPolicies" diff --git a/bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_meeting_usersPolicies.yaml b/bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_meeting_usersPolicies.yaml index fb3299a103..c778c0d934 100644 --- a/bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_meeting_usersPolicies.yaml +++ b/bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_meeting_usersPolicies.yaml @@ -8,6 +8,7 @@ select_permissions: - allowModsToEjectCameras - allowModsToUnmuteUsers - authenticatedGuest + - allowPromoteGuestToModerator - guestLobbyMessage - guestPolicy - maxUserConcurrentAccesses diff --git a/bigbluebutton-html5/imports/ui/Types/meeting.ts b/bigbluebutton-html5/imports/ui/Types/meeting.ts index 61f41e3cc4..5f3c1461c3 100644 --- a/bigbluebutton-html5/imports/ui/Types/meeting.ts +++ b/bigbluebutton-html5/imports/ui/Types/meeting.ts @@ -48,6 +48,7 @@ export interface UsersPolicies { allowModsToEjectCameras: boolean; allowModsToUnmuteUsers: boolean; authenticatedGuest: boolean; + allowPromoteGuestToModerator: boolean; guestPolicy: string; maxUserConcurrentAccesses: number; maxUsers: number; diff --git a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-participants/queries.ts b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-participants/queries.ts index 5f7b189f6c..4bf83dee90 100644 --- a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-participants/queries.ts +++ b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-participants/queries.ts @@ -20,6 +20,7 @@ subscription MeetingPermissions { allowModsToEjectCameras allowModsToUnmuteUsers authenticatedGuest + allowPromoteGuestToModerator guestPolicy maxUserConcurrentAccesses maxUsers diff --git a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-participants/user-actions/service.ts b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-participants/user-actions/service.ts index df8d8afa03..07f2d8950e 100644 --- a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-participants/user-actions/service.ts +++ b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-participants/user-actions/service.ts @@ -55,14 +55,14 @@ export const generateActionsPermissions = ( && !isSubjectUserModerator && !isDialInUser && !isBreakout - && !(isSubjectUserGuest && usersPolicies?.authenticatedGuest); + && !(isSubjectUserGuest && usersPolicies?.authenticatedGuest && !usersPolicies?.allowPromoteGuestToModerator); const allowedToDemote = amIModerator && !amISubjectUser && isSubjectUserModerator && !isDialInUser && !isBreakout - && !(isSubjectUserGuest && usersPolicies?.authenticatedGuest); + && !(isSubjectUserGuest && usersPolicies?.authenticatedGuest && !usersPolicies?.allowPromoteGuestToModerator); const allowedToChangeStatus = amISubjectUser && USER_STATUS_ENABLED; diff --git a/bigbluebutton-web/grails-app/conf/bigbluebutton.properties b/bigbluebutton-web/grails-app/conf/bigbluebutton.properties index 325643c0aa..034dd18d9d 100644 --- a/bigbluebutton-web/grails-app/conf/bigbluebutton.properties +++ b/bigbluebutton-web/grails-app/conf/bigbluebutton.properties @@ -160,6 +160,9 @@ defaultGuestPolicy=ALWAYS_ACCEPT # Enables or disables authenticated guest authenticatedGuest=true +# Allows moderators to promote guests to moderators when authenticatedGuest is enabled +defaultAllowPromoteGuestToModerator=false + #--------------------------------------------------- # Default Meeting Layout # Accepted values are the standard layouts: CUSTOM_LAYOUT, SMART_LAYOUT, PRESENTATION_FOCUS, VIDEO_FOCUS diff --git a/bigbluebutton-web/grails-app/conf/spring/resources.xml b/bigbluebutton-web/grails-app/conf/spring/resources.xml index 3fcfb82980..b6e9ea4831 100755 --- a/bigbluebutton-web/grails-app/conf/spring/resources.xml +++ b/bigbluebutton-web/grails-app/conf/spring/resources.xml @@ -161,6 +161,7 @@ with BigBlueButton; if not, see . +