From 55a97b215d8e3127f931cc67670d520907120ac0 Mon Sep 17 00:00:00 2001
From: =Corey Hulen <corey@hulen.com>
Date: Wed, 10 Feb 2016 14:53:45 -0800
Subject: PLT-1956

---
 web/react/components/user_settings/user_settings_modal.jsx | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

(limited to 'web/react/components/user_settings/user_settings_modal.jsx')

diff --git a/web/react/components/user_settings/user_settings_modal.jsx b/web/react/components/user_settings/user_settings_modal.jsx
index 7e911f09a..5442f7ac4 100644
--- a/web/react/components/user_settings/user_settings_modal.jsx
+++ b/web/react/components/user_settings/user_settings_modal.jsx
@@ -234,7 +234,10 @@ class UserSettingsModal extends React.Component {
 
     render() {
         const {formatMessage} = this.props.intl;
+        var currentUser = UserStore.getCurrentUser();
+        var isAdmin = Utils.isAdmin(currentUser.roles);
         var tabs = [];
+
         tabs.push({name: 'general', uiName: formatMessage(holders.general), icon: 'glyphicon glyphicon-cog'});
         tabs.push({name: 'security', uiName: formatMessage(holders.security), icon: 'glyphicon glyphicon-lock'});
         tabs.push({name: 'notifications', uiName: formatMessage(holders.notifications), icon: 'glyphicon glyphicon-exclamation-sign'});
@@ -243,8 +246,17 @@ class UserSettingsModal extends React.Component {
         }
 
         if (global.window.mm_config.EnableIncomingWebhooks === 'true' || global.window.mm_config.EnableOutgoingWebhooks === 'true' || global.window.mm_config.EnableCommands === 'true') {
-            tabs.push({name: 'integrations', uiName: formatMessage(holders.integrations), icon: 'glyphicon glyphicon-transfer'});
+            var show = global.window.mm_config.EnableOnlyAdminIntegrations !== 'true';
+
+            if (global.window.mm_config.EnableOnlyAdminIntegrations === 'true' && isAdmin) {
+                show = true;
+            }
+
+            if (show) {
+                tabs.push({name: 'integrations', uiName: formatMessage(holders.integrations), icon: 'glyphicon glyphicon-transfer'});
+            }
         }
+
         tabs.push({name: 'display', uiName: formatMessage(holders.display), icon: 'glyphicon glyphicon-eye-open'});
         tabs.push({name: 'advanced', uiName: formatMessage(holders.advanced), icon: 'glyphicon glyphicon-list-alt'});
 
-- 
cgit v1.2.3-1-g7c22

