Skip to content

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

Disable kick participant button for guests

Horatiu Muresand0bc3da0f5c1
diff --git a/interface_config.js b/interface_config.js
index a87ecaf710..f6b7dde252 100644
--- a/interface_config.js
+++ b/interface_config.js
@@ -208,6 +208,11 @@ var interfaceConfig = {
*/
SHOW_CHROME_EXTENSION_BANNER: false
+ /**
+ * When enabled, the kick participant button will not be presented for users without a JWT
+ */
+ // HIDE_KICK_BUTTON_FOR_GUESTS: false
+
/**
* How many columns the tile view can expand to. The respected range is
* between 1 and 5.
diff --git a/react/features/remote-video-menu/components/web/KickButton.js b/react/features/remote-video-menu/components/web/KickButton.js
index e687372b09..12272e48ca 100644
--- a/react/features/remote-video-menu/components/web/KickButton.js
+++ b/react/features/remote-video-menu/components/web/KickButton.js
@@ -12,6 +12,8 @@ import AbstractKickButton, {
import RemoteVideoMenuButton from './RemoteVideoMenuButton';
+declare var interfaceConfig: Object;
+
/**
* Implements a React {@link Component} which displays a button for kicking out
* a participant from the conference.
@@ -41,7 +43,11 @@ class KickButton extends AbstractKickButton {
* @returns {ReactElement}
*/
render() {
- const { participantID, t } = this.props;
+ const { participantID, t, visible } = this.props;
+
+ if (!visible) {
+ return null;
+ }
return (
<RemoteVideoMenuButton
@@ -57,4 +63,21 @@ class KickButton extends AbstractKickButton {
_handleClick: () => void
}
-export default translate(connect()(KickButton));
+/**
+ * Maps (parts of) the redux state to {@link KickButton}'s React {@code Component}
+ * props.
+ *
+ * @param {Object} state - The redux store/state.
+ * @private
+ * @returns {Object}
+ */
+function _mapStateToProps(state: Object) {
+ const shouldHide = interfaceConfig.HIDE_KICK_BUTTON_FOR_GUESTS && state['features/base/jwt'].isGuest;
+
+ return {
+ visible: !shouldHide
+ };
+}
+
+export default translate(connect(_mapStateToProps)(KickButton));
+