Browse Source

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

master
Дамян Минков 6 years ago
parent
commit
f5ac18da18

+ 3
- 0
config.js View File

@@ -266,6 +266,9 @@ var config = {
266 266
     // Whether or not some features are checked based on token.
267 267
     // enableFeaturesBasedOnToken: false,
268 268
 
269
+    // Enable lock room for all moderators, even when userRolesBasedOnToken is enabled and participants are guests.
270
+    // lockRoomGuestEnabled: false,
271
+
269 272
     // Message to show the users. Example: 'The service will be down for
270 273
     // maintenance at 01:00 AM GMT,
271 274
     // noticeMessage: '',

+ 6
- 2
react/features/base/participants/functions.js View File

@@ -266,9 +266,12 @@ function _getAllParticipants(stateful) {
266 266
  *
267 267
  * @param {Object|Function} stateful - Object or function that can be resolved
268 268
  * to the Redux state.
269
+ * @param {?boolean} ignoreToken - When true we ignore the token check.
269 270
  * @returns {boolean}
270 271
  */
271
-export function isLocalParticipantModerator(stateful: Object | Function) {
272
+export function isLocalParticipantModerator(
273
+        stateful: Object | Function,
274
+        ignoreToken: ?boolean = false) {
272 275
     const state = toState(stateful);
273 276
     const localParticipant = getLocalParticipant(state);
274 277
 
@@ -278,7 +281,8 @@ export function isLocalParticipantModerator(stateful: Object | Function) {
278 281
 
279 282
     return (
280 283
         localParticipant.role === PARTICIPANT_ROLE.MODERATOR
281
-            && (!state['features/base/config'].enableUserRolesBasedOnToken
284
+        && (ignoreToken
285
+                || !state['features/base/config'].enableUserRolesBasedOnToken
282 286
                 || !state['features/base/jwt'].isGuest));
283 287
 }
284 288
 

+ 1
- 1
react/features/invite/components/info-dialog/web/InfoDialog.js View File

@@ -588,7 +588,7 @@ function _mapStateToProps(state) {
588 588
     } = state['features/base/conference'];
589 589
 
590 590
     return {
591
-        _canEditPassword: isLocalParticipantModerator(state),
591
+        _canEditPassword: isLocalParticipantModerator(state, state['features/base/config'].lockRoomGuestEnabled),
592 592
         _conference: conference,
593 593
         _conferenceName: room,
594 594
         _inviteURL: getInviteURL(state),

Loading…
Cancel
Save