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
     // Whether or not some features are checked based on token.
266
     // Whether or not some features are checked based on token.
267
     // enableFeaturesBasedOnToken: false,
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
     // Message to show the users. Example: 'The service will be down for
272
     // Message to show the users. Example: 'The service will be down for
270
     // maintenance at 01:00 AM GMT,
273
     // maintenance at 01:00 AM GMT,
271
     // noticeMessage: '',
274
     // noticeMessage: '',

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

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

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

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

Loading…
Cancel
Save