forked from bigbluebutton/bigbluebutton
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'bbb/v3.0.x-release' into oct-25
- Loading branch information
Showing
262 changed files
with
7,667 additions
and
4,462 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 15 additions & 48 deletions
63
...c/main/scala/org/bigbluebutton/core/apps/plugin/PluginDataChannelDeleteEntryMsgHdlr.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,29 @@ | ||
package org.bigbluebutton.core.apps.plugin | ||
|
||
import org.bigbluebutton.ClientSettings | ||
import org.bigbluebutton.common2.msgs.PluginDataChannelDeleteEntryMsg | ||
import org.bigbluebutton.core.apps.plugin.PluginHdlrHelpers.{ checkPermission, dataChannelCheckingLogic, defaultCreatorCheck } | ||
import org.bigbluebutton.core.db.PluginDataChannelEntryDAO | ||
import org.bigbluebutton.core.domain.MeetingState2x | ||
import org.bigbluebutton.core.models.{ Roles, Users2x } | ||
import org.bigbluebutton.core.running.{ HandlerHelpers, LiveMeeting } | ||
|
||
trait PluginDataChannelDeleteEntryMsgHdlr extends HandlerHelpers { | ||
|
||
def handle(msg: PluginDataChannelDeleteEntryMsg, state: MeetingState2x, liveMeeting: LiveMeeting): Unit = { | ||
val pluginsDisabled: Boolean = liveMeeting.props.meetingProp.disabledFeatures.contains("plugins") | ||
val meetingId = liveMeeting.props.meetingProp.intId | ||
|
||
for { | ||
_ <- if (!pluginsDisabled) Some(()) else None | ||
user <- Users2x.findWithIntId(liveMeeting.users2x, msg.header.userId) | ||
} yield { | ||
val pluginsConfig = ClientSettings.getPluginsFromConfig(ClientSettings.clientSettingsFromFile) | ||
|
||
if (!pluginsConfig.contains(msg.body.pluginName)) { | ||
println(s"Plugin '${msg.body.pluginName}' not found.") | ||
} else if (!pluginsConfig(msg.body.pluginName).dataChannels.contains(msg.body.channelName)) { | ||
println(s"Data channel '${msg.body.channelName}' not found in plugin '${msg.body.pluginName}'.") | ||
dataChannelCheckingLogic(liveMeeting, msg.header.userId, msg.body.pluginName, msg.body.channelName, (user, dc, meetingId) => { | ||
val hasPermission = checkPermission(user, dc.replaceOrDeletePermission, defaultCreatorCheck( | ||
meetingId, msg.body, msg.header.userId | ||
)) | ||
if (!hasPermission.contains(true)) { | ||
println(s"No permission to delete in plugin: '${msg.body.pluginName}', data channel: '${msg.body.channelName}'.") | ||
} else { | ||
val hasPermission = for { | ||
replaceOrDeletePermission <- pluginsConfig(msg.body.pluginName).dataChannels(msg.body.channelName).replaceOrDeletePermission | ||
} yield { | ||
replaceOrDeletePermission.toLowerCase match { | ||
case "all" => true | ||
case "moderator" => user.role == Roles.MODERATOR_ROLE | ||
case "presenter" => user.presenter | ||
case "creator" => { | ||
val creatorUserId = PluginDataChannelEntryDAO.getEntryCreator( | ||
meetingId, | ||
msg.body.pluginName, | ||
msg.body.channelName, | ||
msg.body.subChannelName, | ||
msg.body.entryId | ||
) | ||
creatorUserId == msg.header.userId | ||
} | ||
case _ => false | ||
} | ||
} | ||
|
||
if (!hasPermission.contains(true)) { | ||
println(s"No permission to delete in plugin: '${msg.body.pluginName}', data channel: '${msg.body.channelName}'.") | ||
} else { | ||
PluginDataChannelEntryDAO.delete( | ||
meetingId, | ||
msg.body.pluginName, | ||
msg.body.channelName, | ||
msg.body.subChannelName, | ||
msg.body.entryId | ||
) | ||
} | ||
PluginDataChannelEntryDAO.delete( | ||
meetingId, | ||
msg.body.pluginName, | ||
msg.body.channelName, | ||
msg.body.subChannelName, | ||
msg.body.entryId | ||
) | ||
} | ||
} | ||
}) | ||
} | ||
} |
57 changes: 16 additions & 41 deletions
57
...src/main/scala/org/bigbluebutton/core/apps/plugin/PluginDataChannelPushEntryMsgHdlr.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,30 @@ | ||
package org.bigbluebutton.core.apps.plugin | ||
|
||
import org.bigbluebutton.common2.msgs.PluginDataChannelPushEntryMsg | ||
import org.bigbluebutton.ClientSettings | ||
import org.bigbluebutton.core.apps.plugin.PluginHdlrHelpers.{ checkPermission, dataChannelCheckingLogic, defaultCreatorCheck } | ||
import org.bigbluebutton.core.db.PluginDataChannelEntryDAO | ||
import org.bigbluebutton.core.domain.MeetingState2x | ||
import org.bigbluebutton.core.models.{ Roles, Users2x } | ||
import org.bigbluebutton.core.running.{ HandlerHelpers, LiveMeeting } | ||
|
||
trait PluginDataChannelPushEntryMsgHdlr extends HandlerHelpers { | ||
|
||
def handle(msg: PluginDataChannelPushEntryMsg, state: MeetingState2x, liveMeeting: LiveMeeting): Unit = { | ||
val pluginsDisabled: Boolean = liveMeeting.props.meetingProp.disabledFeatures.contains("plugins") | ||
val meetingId = liveMeeting.props.meetingProp.intId | ||
|
||
for { | ||
_ <- if (!pluginsDisabled) Some(()) else None | ||
user <- Users2x.findWithIntId(liveMeeting.users2x, msg.header.userId) | ||
} yield { | ||
val pluginsConfig = ClientSettings.getPluginsFromConfig(ClientSettings.clientSettingsFromFile) | ||
|
||
if (!pluginsConfig.contains(msg.body.pluginName)) { | ||
println(s"Plugin '${msg.body.pluginName}' not found.") | ||
} else if (!pluginsConfig(msg.body.pluginName).dataChannels.contains(msg.body.channelName)) { | ||
println(s"Data channel '${msg.body.channelName}' not found in plugin '${msg.body.pluginName}'.") | ||
dataChannelCheckingLogic(liveMeeting, msg.header.userId, msg.body.pluginName, msg.body.channelName, (user, dc, meetingId) => { | ||
val hasPermission = checkPermission(user, dc.pushPermission) | ||
if (!hasPermission.contains(true)) { | ||
println(s"No permission to write in plugin: '${msg.body.pluginName}', data channel: '${msg.body.channelName}'.") | ||
} else { | ||
val hasPermission = for { | ||
pushPermission <- pluginsConfig(msg.body.pluginName).dataChannels(msg.body.channelName).pushPermission | ||
} yield { | ||
pushPermission.toLowerCase match { | ||
case "all" => true | ||
case "moderator" => user.role == Roles.MODERATOR_ROLE | ||
case "presenter" => user.presenter | ||
case _ => false | ||
} | ||
} | ||
|
||
if (!hasPermission.contains(true)) { | ||
println(s"No permission to write in plugin: '${msg.body.pluginName}', data channel: '${msg.body.channelName}'.") | ||
} else { | ||
PluginDataChannelEntryDAO.insert( | ||
meetingId, | ||
msg.body.pluginName, | ||
msg.body.channelName, | ||
msg.body.subChannelName, | ||
msg.header.userId, | ||
msg.body.payloadJson, | ||
msg.body.toRoles, | ||
msg.body.toUserIds | ||
) | ||
} | ||
PluginDataChannelEntryDAO.insert( | ||
meetingId, | ||
msg.body.pluginName, | ||
msg.body.channelName, | ||
msg.body.subChannelName, | ||
msg.header.userId, | ||
msg.body.payloadJson, | ||
msg.body.toRoles, | ||
msg.body.toUserIds | ||
) | ||
} | ||
} | ||
}) | ||
} | ||
} |
Oops, something went wrong.