Merge pull request #4 from GuiLeme/I-18137-back-end-tweak

[I-18101-back-end-tweak] - back-end portion - review changes
This commit is contained in:
André Castro 2023-06-16 13:26:26 -03:00 committed by GitHub
commit 29be67e226
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 55 additions and 117 deletions

View File

@ -9,14 +9,7 @@ trait CreateTimerPubMsgHdlr extends RightsManagementTrait {
this: TimerApp2x =>
def handle(msg: CreateTimerPubMsg, liveMeeting: LiveMeeting, bus: MessageBus): Unit = {
val isTimerFeatureEnabled: Boolean = !liveMeeting.props.meetingProp.disabledFeatures.contains("timer")
if (!isTimerFeatureEnabled) {
log.error("Timer feature is disabled for meeting {}, meetingId={}", liveMeeting.props.meetingProp.name,
liveMeeting.props.meetingProp.intId)
} else {
log.debug("Received CreateTimerPubMsg {}", CreateTimerPubMsg)
TimerModel.createTimer(liveMeeting.timerModel, msg.body.stopwatch, msg.body.time, msg.body.accumulated, msg.body.track)
}
}
}

View File

@ -23,12 +23,6 @@ trait DeactivateTimerReqMsgHdlr extends RightsManagementTrait {
bus.outGW.send(msgEvent)
}
val isTimerFeatureEnabled: Boolean = !liveMeeting.props.meetingProp.disabledFeatures.contains("timer")
if (!isTimerFeatureEnabled) {
log.error("Timer feature is disabled for meeting {}, meetingId={}", liveMeeting.props.meetingProp.name,
liveMeeting.props.meetingProp.intId)
} else {
if (permissionFailed(PermissionCheck.MOD_LEVEL, PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, msg.header.userId) &&
permissionFailed(PermissionCheck.GUEST_LEVEL, PermissionCheck.PRESENTER_LEVEL, liveMeeting.users2x, msg.header.userId)) {
val meetingId = liveMeeting.props.meetingProp.intId
@ -40,4 +34,3 @@ trait DeactivateTimerReqMsgHdlr extends RightsManagementTrait {
}
}
}
}

View File

@ -23,14 +23,6 @@ trait ResetTimerReqMsgHdlr extends RightsManagementTrait {
bus.outGW.send(msgEvent)
}
val isTimerFeatureEnabled: Boolean = !liveMeeting.props.meetingProp.disabledFeatures.contains("timer")
if (!isTimerFeatureEnabled) {
log.error(
"Timer feature is disabled for meeting {}, meetingId={}",
liveMeeting.props.meetingProp.name, liveMeeting.props.meetingProp.intId
)
} else {
if (permissionFailed(PermissionCheck.MOD_LEVEL, PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, msg.header.userId) &&
permissionFailed(PermissionCheck.GUEST_LEVEL, PermissionCheck.PRESENTER_LEVEL, liveMeeting.users2x, msg.header.userId)) {
val meetingId = liveMeeting.props.meetingProp.intId
@ -41,4 +33,3 @@ trait ResetTimerReqMsgHdlr extends RightsManagementTrait {
}
}
}
}

View File

@ -25,14 +25,6 @@ trait SetTimerReqMsgHdlr extends RightsManagementTrait {
bus.outGW.send(msgEvent)
}
val isTimerFeatureEnabled: Boolean = !liveMeeting.props.meetingProp.disabledFeatures.contains("timer")
if (!isTimerFeatureEnabled) {
log.error(
"Timer feature is disabled for meeting {}, meetingId={}",
liveMeeting.props.meetingProp.name, liveMeeting.props.meetingProp.intId
)
} else {
if (permissionFailed(PermissionCheck.MOD_LEVEL, PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, msg.header.userId) &&
permissionFailed(PermissionCheck.GUEST_LEVEL, PermissionCheck.PRESENTER_LEVEL, liveMeeting.users2x, msg.header.userId)) {
val meetingId = liveMeeting.props.meetingProp.intId
@ -44,4 +36,3 @@ trait SetTimerReqMsgHdlr extends RightsManagementTrait {
}
}
}
}

View File

@ -25,14 +25,6 @@ trait SetTrackReqMsgHdlr extends RightsManagementTrait {
bus.outGW.send(msgEvent)
}
val isTimerFeatureEnabled: Boolean = !liveMeeting.props.meetingProp.disabledFeatures.contains("timer")
if (!isTimerFeatureEnabled) {
log.error(
"Timer feature is disabled for meeting {}, meetingId={}",
liveMeeting.props.meetingProp.name, liveMeeting.props.meetingProp.intId
)
} else {
if (permissionFailed(PermissionCheck.MOD_LEVEL, PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, msg.header.userId) &&
permissionFailed(PermissionCheck.GUEST_LEVEL, PermissionCheck.PRESENTER_LEVEL, liveMeeting.users2x, msg.header.userId)) {
val meetingId = liveMeeting.props.meetingProp.intId
@ -44,4 +36,3 @@ trait SetTrackReqMsgHdlr extends RightsManagementTrait {
}
}
}
}

View File

@ -23,12 +23,6 @@ trait StartTimerReqMsgHdlr extends RightsManagementTrait {
bus.outGW.send(msgEvent)
}
val isTimerFeatureEnabled: Boolean = !liveMeeting.props.meetingProp.disabledFeatures.contains("timer")
if (!isTimerFeatureEnabled) {
log.error("Timer feature is disabled for meeting {}, meetingId={}", liveMeeting.props.meetingProp.name,
liveMeeting.props.meetingProp.intId)
} else {
if (permissionFailed(PermissionCheck.MOD_LEVEL, PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, msg.header.userId) &&
permissionFailed(PermissionCheck.GUEST_LEVEL, PermissionCheck.PRESENTER_LEVEL, liveMeeting.users2x, msg.header.userId)) {
val meetingId = liveMeeting.props.meetingProp.intId
@ -41,4 +35,3 @@ trait StartTimerReqMsgHdlr extends RightsManagementTrait {
}
}
}
}

View File

@ -25,12 +25,6 @@ trait StopTimerReqMsgHdlr extends RightsManagementTrait {
bus.outGW.send(msgEvent)
}
val isTimerFeatureEnabled: Boolean = !liveMeeting.props.meetingProp.disabledFeatures.contains("timer")
if (!isTimerFeatureEnabled) {
log.error("Timer feature is disabled for meeting {}, meetingId={}", liveMeeting.props.meetingProp.name,
liveMeeting.props.meetingProp.intId)
} else {
if (permissionFailed(PermissionCheck.MOD_LEVEL, PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, msg.header.userId) &&
permissionFailed(PermissionCheck.GUEST_LEVEL, PermissionCheck.PRESENTER_LEVEL, liveMeeting.users2x, msg.header.userId) &&
msg.header.userId != "nodeJSapp") {
@ -44,4 +38,3 @@ trait StopTimerReqMsgHdlr extends RightsManagementTrait {
}
}
}
}

View File

@ -25,12 +25,6 @@ trait SwitchTimerReqMsgHdlr extends RightsManagementTrait {
bus.outGW.send(msgEvent)
}
val isTimerFeatureEnabled: Boolean = !liveMeeting.props.meetingProp.disabledFeatures.contains("timer")
if (!isTimerFeatureEnabled) {
log.error("Timer feature is disabled for meeting {}, meetingId={}", liveMeeting.props.meetingProp.name,
liveMeeting.props.meetingProp.intId)
} else {
if (permissionFailed(PermissionCheck.MOD_LEVEL, PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, msg.header.userId) &&
permissionFailed(PermissionCheck.GUEST_LEVEL, PermissionCheck.PRESENTER_LEVEL, liveMeeting.users2x, msg.header.userId)) {
val meetingId = liveMeeting.props.meetingProp.intId
@ -46,4 +40,3 @@ trait SwitchTimerReqMsgHdlr extends RightsManagementTrait {
}
}
}
}