Add option to allow guest(moderators) to add a room password
This commit is contained in:
parent
103ae363f6
commit
f5ac18da18
|
@ -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: '',
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue