diff options
author | enahum <nahumhbl@gmail.com> | 2016-08-30 23:05:23 -0300 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-08-30 22:05:23 -0400 |
commit | db660bdf9cbea09197d8292a8ec8efda8ac41f38 (patch) | |
tree | 00845d6b588c0b149dc56a90b1c7ef9abfc9b9ff /webapp/components/backstage | |
parent | 1326ab66a141e73f1ef7d9d39bb86596f56179e0 (diff) | |
download | chat-db660bdf9cbea09197d8292a8ec8efda8ac41f38.tar.gz chat-db660bdf9cbea09197d8292a8ec8efda8ac41f38.tar.bz2 chat-db660bdf9cbea09197d8292a8ec8efda8ac41f38.zip |
PLT-4007 Fix OAuth: Javascript error when team admin accesses the OAuth 2.0 menu (#3887)
Diffstat (limited to 'webapp/components/backstage')
-rw-r--r-- | webapp/components/backstage/components/backstage_sidebar.jsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/webapp/components/backstage/components/backstage_sidebar.jsx b/webapp/components/backstage/components/backstage_sidebar.jsx index 554e3043e..557c6d804 100644 --- a/webapp/components/backstage/components/backstage_sidebar.jsx +++ b/webapp/components/backstage/components/backstage_sidebar.jsx @@ -40,6 +40,7 @@ export default class BackstageSidebar extends React.Component { renderIntegrations() { const config = window.mm_config; + const isSystemAdmin = Utils.isSystemAdmin(this.props.user.roles); if (config.EnableIncomingWebhooks !== 'true' && config.EnableOutgoingWebhooks !== 'true' && config.EnableCommands !== 'true' && @@ -48,7 +49,7 @@ export default class BackstageSidebar extends React.Component { } if (config.EnableOnlyAdminIntegrations !== 'false' && - !Utils.isSystemAdmin(this.props.user.roles) && + !isSystemAdmin && !TeamStore.isTeamAdmin(this.props.user.id, this.props.team.id)) { return null; } @@ -99,7 +100,7 @@ export default class BackstageSidebar extends React.Component { } let oauthApps = null; - if (config.EnableOAuthServiceProvider === 'true') { + if (config.EnableOAuthServiceProvider === 'true' && (isSystemAdmin || config.EnableOnlyAdminIntegrations !== 'true')) { oauthApps = ( <BackstageSection name='oauth2-apps' |