Repository navigation
feat(recording): adds custom userdata recording permission - #21497
ramonlsouza merged 5 commits into
Conversation
Adds two new userdata parameters: - bbb_record_permission: if true, bypass the moderator/viewer role permission and allows the user to start/stop the recording - bbb_record_permission_tooltip: a string to show in the tooltip when the user don't have permission, useful to explain why the user can't start recording This enables integrations to have custom rules for specific users to have or not permission to record a meeting
WalkthroughThe pull request introduces several modifications across multiple files related to recording management and user permissions in the BigBlueButton application. Key changes include the enhancement of permission validation logic in the Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🔇 Additional comments (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (13)
bigbluebutton-html5/imports/ui/components/recording/queries.ts (1)
8-12: LGTM! Consider adding a property for the custom tooltip.The new
GetRecordingPoliciesResponseinterface is well-structured and aligns with the PR objectives for custom recording permissions. However, it might be beneficial to include a property for the custom tooltip message (bbb_record_permission_tooltip) mentioned in the PR objectives.Consider adding a property for the custom tooltip message:
export interface GetRecordingPoliciesResponse { meeting_recordingPolicies: { allowStartStopRecording: boolean; + customTooltip?: string; }[] }bigbluebutton-html5/imports/ui/components/nav-bar/nav-bar-graphql/recording-indicator/service.tsx (2)
3-10: LGTM: Function implements custom recording permissions as intended.The
mayIRecordfunction correctly implements the logic for custom recording permissions as described in the PR objectives. It properly checks theallowStartStopRecordingflag, custom permissions, and moderator status in the correct order.A minor suggestion for improvement:
Consider adding a type annotation for the return value of the function for better clarity:
const mayIRecord = (amIModerator: boolean, allowStartStopRecording: boolean): boolean => { // ... existing implementation ... };
12-15: LGTM: Export includes necessary functions for recording permissions and tooltips.The default export correctly includes the
mayIRecordfunction and agetCustomRecordTooltipfunction, which aligns with the PR objectives.A minor suggestion for improvement:
Consider adding type annotations for the exported object and the
getCustomRecordTooltipfunction for better type safety:export default { mayIRecord, getCustomRecordTooltip: (value: string): string => getFromUserSettings('bbb_record_permission_tooltip', value), } as const;This change adds a return type for
getCustomRecordTooltipand usesas constto make the object properties readonly, which can help prevent accidental modifications.bigbluebutton-html5/imports/ui/components/nav-bar/nav-bar-graphql/recording-indicator/component.tsx (2)
238-239: LGTM: Implemented custom recording tooltipThe introduction of
customRecordTooltipusingService.getCustomRecordTooltipimplements the custom tooltip feature described in the PR objectives. This allows for dynamic tooltip content based on user permissions.Consider renaming
defaultRecordTooltiptodefaultRecordingTooltipfor consistency with other variable names in the file.
255-262: LGTM: Updated tooltip rendering with custom contentThe tooltip rendering logic has been correctly updated to use the new
customRecordTooltip. This change ensures that the appropriate message is shown for both recording and non-recording states, and the aria-label is updated to match the tooltip content, improving accessibility.Consider refactoring the repeated ternary operation into a single variable for improved readability:
+ const tooltipContent = recording + ? `${intl.formatMessage(intlMessages.notificationRecordingStart)}` + : customRecordTooltip; <Tooltip - title={recording - ? `${intl.formatMessage(intlMessages.notificationRecordingStart)}` - : customRecordTooltip} + title={tooltipContent} > <Styled.RecordingStatusViewOnly - aria-label={recording - ? `${intl.formatMessage(intlMessages.notificationRecordingStart)}` - : customRecordTooltip} + aria-label={tooltipContent} recording={recording} >docs/docs/administration/customize.md (8)
Line range hint
16-18: Consider adding a brief introduction.While the file jumps straight into the content, it might be helpful to add a brief introduction explaining the purpose of this document and what readers can expect to learn.
🧰 Tools
🪛 Markdownlint
1400-1400: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style(MD055, table-pipe-style)
1400-1400: Expected: 3; Actual: 2; Too few cells, row will be missing data
Table column count(MD056, table-column-count)
Line range hint
20-67: Emphasize best practices for configuration management.The section provides valuable information about preserving configuration changes. Consider the following improvements:
- Add a note emphasizing the importance of documenting all custom changes made to the configuration.
- Highlight the recommendation for BigBlueButton 2.6 more prominently, perhaps in a callout box or with bold text.
- Provide an example of a well-structured
apply-config.shfile to illustrate best practices.These additions would help users better understand and implement proper configuration management.
🧰 Tools
🪛 Markdownlint
1400-1400: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style(MD055, table-pipe-style)
1400-1400: Expected: 3; Actual: 2; Too few cells, row will be missing data
Table column count(MD056, table-column-count)
Line range hint
69-71: Add a warning about potential impacts of changing recording retention.In the "Delete raw data from published recordings" subsection, consider adding a warning about the potential impacts of changing the retention period. For example:
"Warning: Reducing the retention period may result in the permanent loss of raw recording data. Ensure you understand the implications before making changes."
This would help users make informed decisions about modifying these settings.
Also applies to: 73-89
🧰 Tools
🪛 Markdownlint
1400-1400: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style(MD055, table-pipe-style)
1400-1400: Expected: 3; Actual: 2; Too few cells, row will be missing data
Table column count(MD056, table-column-count)
Line range hint
280-307: Clarify the process for enabling iOS playback.In the "Enable playback of recordings on iOS" subsection, the instructions are clear, but it might be helpful to add:
- An explanation of why this change is necessary (iOS limitations on video formats).
- A note about the increased processing time and storage requirements when generating both WebM and MP4 formats.
- Instructions on how to test the iOS playback after making the change.
These additions would provide users with a more complete understanding of the modification and its implications.
🧰 Tools
🪛 Markdownlint
1400-1400: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style(MD055, table-pipe-style)
1400-1400: Expected: 3; Actual: 2; Too few cells, row will be missing data
Table column count(MD056, table-column-count)
Line range hint
1036-1054: Provide more context for HTML5 client customization.In the "Change favicon" subsection, consider adding:
- A brief explanation of what a favicon is and why someone might want to change it.
- An example of the recommended favicon size and format.
- A note about potential caching issues when changing the favicon and how to address them.
These additions would make the instructions more comprehensive and user-friendly.
🧰 Tools
🪛 Markdownlint
1400-1400: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style(MD055, table-pipe-style)
1400-1400: Expected: 3; Actual: 2; Too few cells, row will be missing data
Table column count(MD056, table-column-count)
Line range hint
1056-1082: Add examples for custom CSS modifications.In the "Change title in the HTML5 client" subsection, it would be helpful to provide a few more examples of common CSS modifications users might want to make. For instance:
- Changing the color scheme of the interface.
- Modifying the size or appearance of specific UI elements.
- Adding custom branding elements.
These examples would give users a better starting point for their own customizations.
🧰 Tools
🪛 Markdownlint
1400-1400: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style(MD055, table-pipe-style)
1400-1400: Expected: 3; Actual: 2; Too few cells, row will be missing data
Table column count(MD056, table-column-count)
Line range hint
1387-1407: Add security best practices for shared secret management.In the "Change the shared secret" subsection, consider adding the following security recommendations:
- Use a cryptographically secure random number generator for creating the new secret, rather than relying on online UUID generators.
- Emphasize the importance of keeping the shared secret confidential and not sharing it in unsecured communications.
- Recommend periodically rotating the shared secret as a security best practice.
These additions would help users implement more secure practices when managing the shared secret.
🧰 Tools
🪛 Markdownlint
1400-1400: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style(MD055, table-pipe-style)
1400-1400: Expected: 3; Actual: 2; Too few cells, row will be missing data
Table column count(MD056, table-column-count)
Line range hint
1409-1421: Provide more information about webhooks security.In the "Install callback for events (webhooks)" subsection, consider adding:
- A brief explanation of the security implications of using webhooks.
- Recommendations for securing the webhook endpoints, such as using HTTPS and implementing authentication.
- A note about monitoring and rate limiting webhook requests to prevent potential abuse.
These additions would help users understand and mitigate potential security risks when using webhooks.
🧰 Tools
🪛 Markdownlint
1400-1400: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style(MD055, table-pipe-style)
1400-1400: Expected: 3; Actual: 2; Too few cells, row will be missing data
Table column count(MD056, table-column-count)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (8)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/SetRecordingStatusCmdMsgHdlr.scala (2 hunks)
- bbb-graphql-actions/src/actions/meetingRecordingSetStatus.ts (1 hunks)
- bigbluebutton-html5/imports/ui/components/nav-bar/nav-bar-graphql/recording-indicator/component.tsx (4 hunks)
- bigbluebutton-html5/imports/ui/components/nav-bar/nav-bar-graphql/recording-indicator/service.tsx (1 hunks)
- bigbluebutton-html5/imports/ui/components/recording/component.tsx (0 hunks)
- bigbluebutton-html5/imports/ui/components/recording/container.tsx (3 hunks)
- bigbluebutton-html5/imports/ui/components/recording/queries.ts (1 hunks)
- docs/docs/administration/customize.md (1 hunks)
💤 Files with no reviewable changes (1)
- bigbluebutton-html5/imports/ui/components/recording/component.tsx
🧰 Additional context used
🔇 Additional comments (18)
bigbluebutton-html5/imports/ui/components/recording/queries.ts (1)
8-12: Verify the usage of the new interface across the codebase.The introduction of
GetRecordingPoliciesResponseinterface suggests a shift towards more granular control over recording permissions. Ensure that all relevant components and services are updated to use this new interface correctly.Run the following script to check the usage of the new interface:
✅ Verification successful
Usage of
GetRecordingPoliciesResponseis properly implemented throughout the codebase.
All relevant components and services have been updated to utilize the new interface correctly.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check the usage of GetRecordingPoliciesResponse interface # Test 1: Find all occurrences of GetRecordingPoliciesResponse echo "Occurrences of GetRecordingPoliciesResponse:" rg -n "GetRecordingPoliciesResponse" # Test 2: Check for potential places where the interface should be used echo "\nPotential places where GetRecordingPoliciesResponse should be used:" rg -n "recording.*(policies|permissions)"Length of output: 918
bigbluebutton-html5/imports/ui/components/nav-bar/nav-bar-graphql/recording-indicator/service.tsx (2)
1-1: LGTM: Import statement is correct and necessary.The import of
getFromUserSettingsis properly done and is used in the code.
1-15: Overall assessment: Well-implemented custom recording permissions and tooltip functionality.This new file successfully implements the custom recording permissions and tooltip functionality as described in the PR objectives. The code is well-structured, follows TypeScript conventions, and efficiently handles the new requirements.
Key points:
- The
mayIRecordfunction correctly implements the logic for determining recording permissions based on moderator status, global settings, and custom user settings.- The
getCustomRecordTooltipfunction provides a way to retrieve custom tooltips as required.- The implementation is concise and easy to understand.
Minor suggestions for improvement have been made regarding type annotations, but these are not critical issues. Overall, the implementation looks good and ready for integration.
bbb-graphql-actions/src/actions/meetingRecordingSetStatus.ts (2)
6-8: LGTM: Improved formatting for input validation.The formatting changes in the input validation array enhance code readability while maintaining the same functionality.
1-5: Verify the impact of removing the moderator check.The removal of
throwErrorIfNotModerator(sessionVariables);aligns with the PR objective of introducing custom recording permissions. This change allows for more flexible permission handling based on the newbbb_record_permissionparameter.However, please ensure that:
- The permission check is properly implemented in the
SetRecordingStatusCmdMsgHdlras mentioned in the PR summary.- There are no security implications from removing this check at this level.
To verify the implementation of the new permission check, please run the following script:
This will help confirm that the new permission logic is correctly implemented in the Scala handler.
✅ Verification successful
Removal of the moderator check verified.
The
bbb_record_permissionis properly implemented inSetRecordingStatusCmdMsgHdlr.scala, ensuring that permission checks are enforced with the new custom recording permissions. No security implications were identified from removing the moderator check at this level.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation of the new permission check in SetRecordingStatusCmdMsgHdlr # Test: Search for the implementation of the new permission check rg -A 10 "bbb_record_permission" --type scalaLength of output: 1612
bigbluebutton-html5/imports/ui/components/nav-bar/nav-bar-graphql/recording-indicator/component.tsx (3)
31-31: LGTM: New Service module import addedThe addition of the
Serviceimport aligns with the PR objectives to introduce custom userdata recording permissions. This module likely encapsulates the new logic for permission checks and tooltip retrieval.
Line range hint
1-430: Overall assessment: Changes successfully implement PR objectivesThe modifications to the
RecordingIndicatorcomponent successfully implement the custom userdata recording permissions and tooltips as described in the PR objectives. The code is well-structured, follows React best practices, and improves the flexibility of recording permissions and user feedback.Key improvements:
- Introduction of
Service.mayIRecordfor custom permission checks.- Implementation of
Service.getCustomRecordTooltipfor dynamic tooltip content.- Updated rendering logic to utilize the new custom permissions and tooltips.
These changes enhance the recording functionality by allowing for more granular control over user permissions and providing clearer feedback to users about their recording capabilities.
237-237: LGTM: Implemented custom recording permission checkThe use of
Service.mayIRecordimplements the new custom permission logic as described in the PR objectives. This change allows for more flexible permission handling based on user metadata.Consider adding error handling for the
mayIRecordfunction call. You can verify its implementation with:docs/docs/administration/customize.md (2)
Line range hint
1-14: LGTM: File structure and metadata look good.The file starts with appropriate metadata for a documentation page, including id, slug, title, and keywords. This helps with proper organization and searchability of the documentation.
🧰 Tools
🪛 Markdownlint
1400-1400: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style(MD055, table-pipe-style)
1400-1400: Expected: 3; Actual: 2; Too few cells, row will be missing data
Table column count(MD056, table-column-count)
Line range hint
1-1421: Excellent comprehensive guide for BigBlueButton customization.This document provides a wealth of information on customizing various aspects of BigBlueButton. It covers a wide range of topics, from basic configuration changes to advanced customizations of the HTML5 client. The step-by-step instructions and code examples are particularly helpful.
Some suggestions for further improvement:
- Consider adding a table of contents at the beginning for easier navigation.
- Standardize the format of warning messages and best practice recommendations throughout the document.
- Include version information where specific features or configurations are version-dependent.
Overall, this is an invaluable resource for BigBlueButton administrators and developers looking to tailor their installations.
🧰 Tools
🪛 Markdownlint
1400-1400: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style(MD055, table-pipe-style)
1400-1400: Expected: 3; Actual: 2; Too few cells, row will be missing data
Table column count(MD056, table-column-count)
bigbluebutton-html5/imports/ui/components/recording/container.tsx (5)
5-5: Import statement is correct and consistent.The addition of
GetRecordingPoliciesResponsefrom./queriesis appropriate and follows existing import patterns.
8-9: New imports are appropriate and correctly used.The inclusion of
GET_MEETING_RECORDING_DATA,GET_MEETING_RECORDING_POLICIES, andServiceimports is correct and necessary for the component's functionality.
28-30: Subscription to recording policies is correctly implemented.The
useDeduplicatedSubscriptionhook is properly used to subscribe toGET_MEETING_RECORDING_POLICIES, ensuring that recording policies are fetched efficiently.
34-34: Recording policy is correctly extracted with safety checks.The
allowStartStopRecordingvariable is safely retrieved using optional chaining and a default value, preventing potential errors if the data is undefined.
45-48: Permission check correctly implemented to conditionally render the component.The component will not render if the user does not have recording permissions (
!mayIRecord), which aligns with the intended functionality and enhances security.akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/SetRecordingStatusCmdMsgHdlr.scala (3)
12-12: Appropriate import forUsers2xmodelThe import of
Users2xis necessary for accessing user metadata and implementing custom recording permissions.
38-42: Permission logic correctly integrates custom recording permissionsThe
hasPermissionvariable effectively incorporates the custom recording permissions, defaulting to the standard permission checks when not specified by user metadata.
45-45: Updated error message provides clearer contextThe revised error message
"No permission to set recording status in meeting."clearly communicates the reason for permission denial when a user lacks the necessary permissions.
| val customRecordPermission: Option[Boolean] = Users2x.findWithIntId(liveMeeting.users2x, msg.header.userId).flatMap { user => | ||
| user.userMetadata.get("bbb_record_permission").map(_.toBoolean) |
There was a problem hiding this comment.
Handle potential exceptions when converting user metadata to Boolean
Using .toBoolean can throw an exception if the metadata value is not exactly "true" or "false". To prevent runtime exceptions, consider using a safer conversion method that handles invalid or unexpected values gracefully.
Apply this diff to handle invalid Boolean values:
val customRecordPermission: Option[Boolean] = Users2x.findWithIntId(liveMeeting.users2x, msg.header.userId).flatMap { user =>
- user.userMetadata.get("bbb_record_permission").map(_.toBoolean)
+ user.userMetadata.get("bbb_record_permission").map {
+ case value if value.equalsIgnoreCase("true") => true
+ case value if value.equalsIgnoreCase("false") => false
+ case _ => false
+ }
}Alternatively, if you're using Scala 2.13 or later, you can use .toBooleanOption which returns an Option[Boolean]:
val customRecordPermission: Option[Boolean] = Users2x.findWithIntId(liveMeeting.users2x, msg.header.userId).flatMap { user =>
- user.userMetadata.get("bbb_record_permission").map(_.toBoolean)
+ user.userMetadata.get("bbb_record_permission").flatMap(_.toBooleanOption)
}Let me know if you need assistance with implementing this change.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| val customRecordPermission: Option[Boolean] = Users2x.findWithIntId(liveMeeting.users2x, msg.header.userId).flatMap { user => | |
| user.userMetadata.get("bbb_record_permission").map(_.toBoolean) | |
| val customRecordPermission: Option[Boolean] = Users2x.findWithIntId(liveMeeting.users2x, msg.header.userId).flatMap { user => | |
| user.userMetadata.get("bbb_record_permission").map { | |
| case value if value.equalsIgnoreCase("true") => true | |
| case value if value.equalsIgnoreCase("false") => false | |
| case _ => false | |
| } |
|
This pull request has conflicts ☹ |
Co-authored-by: Anton Georgiev <[email protected]>
|
Automated tests Summary✅ All the CI tests have passed! |



What does this PR do?
Adds two new userdata parameters:
bbb_record_permission: if true, bypass the moderator/viewer role permission check and allows the user to start/stop the recording. Also, if set to false will deny the user to record even if he is a moderatorbbb_record_permission_tooltip: a string to show in the tooltip when the user don't have permission, useful to explain why the user can't start recordingMotivation
This enables integrations to have custom rules for specific users to have or not permission to record a meeting
How to test
Set
userdata-bbb_record_permissionanduserdata-bbb_record_permission_tooltipin custom parameters before joining and see the effect in meeting.For example. setting
and joining as moderator, the user will not be enabled to record and the tooltip will show the message:
