Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Add option to allow guest(moderators) to add a room password

Дамян Минковf5ac18da18fe
diff --git a/config.js b/config.js
index d14d9cfd65..3589d3d23b 100644
--- a/config.js
+++ b/config.js
@@ -266,6 +266,9 @@ var config = {
// Whether or not some features are checked based on token.
// enableFeaturesBasedOnToken: false,
+ // Enable lock room for all moderators, even when userRolesBasedOnToken is enabled and participants are guests.
+ // lockRoomGuestEnabled: false,
+
// Message to show the users. Example: 'The service will be down for
// maintenance at 01:00 AM GMT,
// noticeMessage: '',
diff --git a/react/features/base/participants/functions.js b/react/features/base/participants/functions.js
index 025bb6bf3f..1a73a75b8e 100644
--- a/react/features/base/participants/functions.js
+++ b/react/features/base/participants/functions.js
@@ -266,9 +266,12 @@ function _getAllParticipants(stateful) {
*
* @param {Object|Function} stateful - Object or function that can be resolved
* to the Redux state.
+ * @param {?boolean} ignoreToken - When true we ignore the token check.
* @returns {boolean}
*/
-export function isLocalParticipantModerator(stateful: Object | Function) {
+export function isLocalParticipantModerator(
+ stateful: Object | Function,
+ ignoreToken: ?boolean = false) {
const state = toState(stateful);
const localParticipant = getLocalParticipant(state);
@@ -278,7 +281,8 @@ export function isLocalParticipantModerator(stateful: Object | Function) {
return (
localParticipant.role === PARTICIPANT_ROLE.MODERATOR
- && (!state['features/base/config'].enableUserRolesBasedOnToken
+ && (ignoreToken
+ || !state['features/base/config'].enableUserRolesBasedOnToken
|| !state['features/base/jwt'].isGuest));
}
diff --git a/react/features/invite/components/info-dialog/web/InfoDialog.js b/react/features/invite/components/info-dialog/web/InfoDialog.js
index e005446ad5..a1b5c886f6 100644
--- a/react/features/invite/components/info-dialog/web/InfoDialog.js
+++ b/react/features/invite/components/info-dialog/web/InfoDialog.js
@@ -588,7 +588,7 @@ function _mapStateToProps(state) {
} = state['features/base/conference'];
return {
- _canEditPassword: isLocalParticipantModerator(state),
+ _canEditPassword: isLocalParticipantModerator(state, state['features/base/config'].lockRoomGuestEnabled),
_conference: conference,
_conferenceName: room,
_inviteURL: getInviteURL(state),