Hides sip dialout button if configured to show it for non guest users.

This commit is contained in:
damencho 2017-04-17 16:40:21 -05:00 committed by Paweł Domas
parent c8ab1b9892
commit 32ea2161eb
1 changed files with 6 additions and 1 deletions

View File

@ -227,10 +227,15 @@ export function showSharedVideoButton(): Function {
export function showSIPCallButton(show: boolean): Function { export function showSIPCallButton(show: boolean): Function {
return (dispatch: Dispatch<*>) => { return (dispatch: Dispatch<*>) => {
const buttonName = 'sip'; const buttonName = 'sip';
// hide the button if there is a config to check for user roles,
// based on the token and the the user is guest
const shouldShow const shouldShow
= APP.conference.sipGatewayEnabled() = APP.conference.sipGatewayEnabled()
&& UIUtil.isButtonEnabled(buttonName) && UIUtil.isButtonEnabled(buttonName)
&& show; && show
&& (!config.enableUserRolesBasedOnToken
|| !APP.tokenData.isGuest);
if (shouldShow) { if (shouldShow) {
dispatch(setToolbarButton(buttonName, { dispatch(setToolbarButton(buttonName, {