Skip to content

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

feat: Drop enableUserRolesBasedOnToken and isGuest.

damencho0934fffa25a8
diff --git a/config.js b/config.js
index 580a0c53e3..d6c1e6ab2a 100644
--- a/config.js
+++ b/config.js
@@ -362,11 +362,6 @@ var config = {
// Disables profile and the edit of all fields from the profile settings (display name and email)
// disableProfile: false,
- // If true all users without a token will be considered guests and all users
- // with token will be considered non-guests. Only guests will be allowed to
- // edit their profile.
- enableUserRolesBasedOnToken: false,
-
// Whether or not some features are checked based on token.
// enableFeaturesBasedOnToken: false,
diff --git a/react/features/app/actions.js b/react/features/app/actions.js
index 95a0287773..4761164284 100644
--- a/react/features/app/actions.js
+++ b/react/features/app/actions.js
@@ -298,13 +298,13 @@ export function maybeRedirectToWelcomePage(options: Object = {}) {
return;
}
- const { isGuest, jwt } = getState()['features/base/jwt'];
+ const { jwt } = getState()['features/base/jwt'];
let hashParam;
// save whether current user is guest or not, and pass auth token,
// before navigating to close page
- window.sessionStorage.setItem('guest', isGuest);
+ window.sessionStorage.setItem('guest', !jwt);
window.sessionStorage.setItem('jwt', jwt);
let path = 'close.html';
diff --git a/react/features/base/jwt/middleware.js b/react/features/base/jwt/middleware.js
index 8c524f4c2c..5060d38411 100644
--- a/react/features/base/jwt/middleware.js
+++ b/react/features/base/jwt/middleware.js
@@ -29,10 +29,7 @@ MiddlewareRegistry.register(store => next => action => {
case SET_CONFIG:
case SET_LOCATION_URL:
// XXX The JSON Web Token (JWT) is not the only piece of state that we
- // have decided to store in the feature jwt, there is isGuest as well
- // which depends on the states of the features base/config and jwt. So
- // the JSON Web Token comes from the conference/room's URL and isGuest
- // needs a recalculation upon SET_CONFIG as well.
+ // have decided to store in the feature jwt
return _setConfigOrLocationURL(store, next, action);
case SET_JWT:
@@ -128,12 +125,6 @@ function _setJWT(store, next, action) {
if (!Object.keys(actionPayload).length) {
if (jwt) {
- const {
- enableUserRolesBasedOnToken
- } = store.getState()['features/base/config'];
-
- action.isGuest = !enableUserRolesBasedOnToken;
-
let jwtPayload;
try {
diff --git a/react/features/base/jwt/reducer.js b/react/features/base/jwt/reducer.js
index 73a0d0b220..42b139ceb8 100644
--- a/react/features/base/jwt/reducer.js
+++ b/react/features/base/jwt/reducer.js
@@ -4,24 +4,6 @@ import { equals, ReducerRegistry } from '../redux';
import { SET_JWT } from './actionTypes';
-/**
- * The default/initial redux state of the feature jwt.
- *
- * @private
- * @type {{
- * isGuest: boolean
- * }}
- */
-const DEFAULT_STATE = {
- /**
- * The indicator which determines whether the local participant is a guest
- * in the conference.
- *
- * @type {boolean}
- */
- isGuest: true
-};
-
/**
* Reduces redux actions which affect the JSON Web Token (JWT) stored in the
* redux store.
@@ -33,13 +15,12 @@ const DEFAULT_STATE = {
*/
ReducerRegistry.register(
'features/base/jwt',
- (state = DEFAULT_STATE, action) => {
+ (state = {}, action) => {
switch (action.type) {
case SET_JWT: {
// eslint-disable-next-line no-unused-vars
const { type, ...payload } = action;
const nextState = {
- ...DEFAULT_STATE,
...payload
};
diff --git a/react/features/base/participants/functions.js b/react/features/base/participants/functions.js
index f6dacaed96..28d39f8fe0 100644
--- a/react/features/base/participants/functions.js
+++ b/react/features/base/participants/functions.js
@@ -308,10 +308,7 @@ export function isLocalParticipantModerator(stateful: Object | Function) {
return false;
}
- return (
- localParticipant.role === PARTICIPANT_ROLE.MODERATOR
- && (!state['features/base/config'].enableUserRolesBasedOnToken
- || !state['features/base/jwt'].isGuest));
+ return localParticipant.role === PARTICIPANT_ROLE.MODERATOR;
}
/**
diff --git a/react/features/invite/functions.js b/react/features/invite/functions.js
index 949602aec4..0d9b7412af 100644
--- a/react/features/invite/functions.js
+++ b/react/features/invite/functions.js
@@ -352,7 +352,7 @@ export function invitePeopleAndChatRooms( // eslint-disable-line max-params
export function isAddPeopleEnabled(state: Object): boolean {
const { peopleSearchUrl } = state['features/base/config'];
- return !isGuest(state) && Boolean(peopleSearchUrl);
+ return state['features/base/jwt'].jwt && Boolean(peopleSearchUrl);
}
/**
@@ -368,16 +368,6 @@ export function isDialOutEnabled(state: Object): boolean {
&& conference && conference.isSIPCallingSupported();
}
-/**
- * Determines if the current user is guest or not.
- *
- * @param {Object} state - Current state.
- * @returns {boolean}
- */
-export function isGuest(state: Object): boolean {
- return state['features/base/jwt'].isGuest;
-}
-
/**
* Checks whether a string looks like it could be for a phone number.
*