|
@@ -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
|
|