Merge pull request #11383 from aron-2809/fix-issue-11182

User role is incorrect after client reconnect.
This commit is contained in:
Richard Alam 2021-02-11 14:53:55 -05:00 committed by GitHub
commit 71eb8cc664
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ trait ChangeUserRoleCmdMsgHdlr extends RightsManagementTrait {
uvo <- Users2x.findWithIntId(liveMeeting.users2x, msg.body.userId) uvo <- Users2x.findWithIntId(liveMeeting.users2x, msg.body.userId)
} yield { } yield {
val userRole = if (uvo.role == Roles.MODERATOR_ROLE) "MODERATOR" else "VIEWER" val userRole = if (msg.body.role == Roles.MODERATOR_ROLE) Roles.MODERATOR_ROLE else Roles.VIEWER_ROLE
for { for {
// Update guest from waiting list // Update guest from waiting list
u <- RegisteredUsers.findWithUserId(uvo.intId, liveMeeting.registeredUsers) u <- RegisteredUsers.findWithUserId(uvo.intId, liveMeeting.registeredUsers)
@ -33,12 +33,12 @@ trait ChangeUserRoleCmdMsgHdlr extends RightsManagementTrait {
// Promote non-guest users. // Promote non-guest users.
Users2x.changeRole(liveMeeting.users2x, uvo, msg.body.role) Users2x.changeRole(liveMeeting.users2x, uvo, msg.body.role)
val event = buildUserRoleChangedEvtMsg(liveMeeting.props.meetingProp.intId, msg.body.userId, val event = buildUserRoleChangedEvtMsg(liveMeeting.props.meetingProp.intId, msg.body.userId,
msg.body.changedBy, "MODERATOR") msg.body.changedBy, Roles.MODERATOR_ROLE)
outGW.send(event) outGW.send(event)
} else if (msg.body.role == Roles.VIEWER_ROLE) { } else if (msg.body.role == Roles.VIEWER_ROLE) {
Users2x.changeRole(liveMeeting.users2x, uvo, msg.body.role) Users2x.changeRole(liveMeeting.users2x, uvo, msg.body.role)
val event = buildUserRoleChangedEvtMsg(liveMeeting.props.meetingProp.intId, msg.body.userId, val event = buildUserRoleChangedEvtMsg(liveMeeting.props.meetingProp.intId, msg.body.userId,
msg.body.changedBy, "VIEWER") msg.body.changedBy, Roles.VIEWER_ROLE)
outGW.send(event) outGW.send(event)
} }
} }