Repository navigation
fix: lockSettingsHideUserList leaks usernames in the chat if a viewer was (temp) set to presenter - #25000
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe changes add permission checks that suppress system chat messages revealing viewer identities when the meeting is configured with hide-user-list. Presenter-assignment announcements and away-status system messages are now skipped if permissions.hideUserList is true and the affected user has role VIEWER. Imports were added to access Roles and MeetingStatus2x for these checks. Sequence Diagram(s)sequenceDiagram
actor Moderator
participant AssignPresenterReqMsgHdlr as "AssignPresenterReqMsgHdlr"
participant MeetingStatus as "MeetingStatus2x.getPermissions"
participant ChatDAO as "ChatMessageDAO"
participant Broadcast as "BroadcastService"
Moderator->>AssignPresenterReqMsgHdlr: request assign presenter
AssignPresenterReqMsgHdlr->>MeetingStatus: getPermissions(meeting.status)
MeetingStatus-->>AssignPresenterReqMsgHdlr: permissions (hideUserList)
AssignPresenterReqMsgHdlr-->>AssignPresenterReqMsgHdlr: evaluate newPres.role == VIEWER & hideUserList
alt not (hideUserList & viewer)
AssignPresenterReqMsgHdlr->>ChatDAO: insertSystemMsg("USER_IS_PRESENTER_MSG")
ChatDAO-->>Broadcast: message persisted
Broadcast-->>Moderator: notify clients
else suppressed
AssignPresenterReqMsgHdlr-->>Broadcast: skip system message, continue other updates
Broadcast-->>Moderator: notify clients (no presenter system chat)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/AssignPresenterReqMsgHdlr.scala (1)
129-139: ⚡ Quick winAdd regression tests for both viewer-in-message branches.
Please add focused coverage for:
hideUserList=true+newPresis viewer, andhideUserList=true+assignedByis viewer.
This path is privacy-sensitive and worth pinning with tests.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/AssignPresenterReqMsgHdlr.scala` around lines 129 - 139, Add two focused regression tests for AssignPresenterReqMsgHdlr behavior when hideUserList is true: one where newPres has role Roles.VIEWER_ROLE and one where assignedBy user has role Roles.VIEWER_ROLE; each test should construct a liveMeeting with MeetingStatus2x.getPermissions(...).hideUserList = true, set up Users2x entries so assignedBy and newPres have the appropriate roles, invoke the handler (or the method that computes shouldSkip) and assert that ChatMessageDAO.insertSystemMsg is NOT called (or that no USER_IS_PRESENTER_MSG is persisted) for both branches, and include a complementary positive test where a non-viewer assignment does emit the message to ensure correctness.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/AssignPresenterReqMsgHdlr.scala`:
- Around line 129-139: Add two focused regression tests for
AssignPresenterReqMsgHdlr behavior when hideUserList is true: one where newPres
has role Roles.VIEWER_ROLE and one where assignedBy user has role
Roles.VIEWER_ROLE; each test should construct a liveMeeting with
MeetingStatus2x.getPermissions(...).hideUserList = true, set up Users2x entries
so assignedBy and newPres have the appropriate roles, invoke the handler (or the
method that computes shouldSkip) and assert that ChatMessageDAO.insertSystemMsg
is NOT called (or that no USER_IS_PRESENTER_MSG is persisted) for both branches,
and include a complementary positive test where a non-viewer assignment does
emit the message to ensure correctness.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: e7940050-0769-440f-8ef2-35815dd1d99c
📒 Files selected for processing (3)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/AssignPresenterReqMsgHdlr.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeUserAwayReqMsgHdlr.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala
|
Hi @ramonlsouza I find we've had to add a bunch more logic for |
Yes, it makes sense to rename it to something that makes it clear that not only the user list is affected |
| val assignedByName = assignedByUser.map(_.name).getOrElse("") | ||
|
|
||
| val hideUserList = MeetingStatus2x.getPermissions(liveMeeting.status).hideUserList | ||
| val assignedByIsViewer = assignedByUser.exists(_.role == Roles.VIEWER_ROLE) |
There was a problem hiding this comment.
Only moderators can assign presenter.
So I think you can revert this validation and validate only the assigned user role.
|
9fd5e4d
into
bigbluebutton:v3.0.x-develop
🚨 Automated tests failed |



What does this PR do?
lockSettingsHideUserListis active and a user mentioned in the message is a viewerlockSettingsHideUserListis active and user is a viewerCloses Issue(s)
Closes #24984