PLT-4007 Fix OAuth: Javascript error when team admin accesses the OAuth 2.0 menu (#3887)

Этот коммит содержится в:
enahum
2016-08-30 23:05:23 -03:00
коммит произвёл Joram Wilander
родитель 1326ab66a1
Коммит db660bdf9c
3 изменённых файлов: 10 добавлений и 5 удалений

Просмотреть файл

@@ -11,16 +11,20 @@ import OutgoingWebhookIcon from 'images/outgoing_webhook.jpg';
import SlashCommandIcon from 'images/slash_command_icon.jpg';
import OAuthIcon from 'images/oauth_icon.png';
import * as Utils from 'utils/utils.jsx';
export default class Integrations extends React.Component {
static get propTypes() {
return {
team: React.propTypes.object.isRequired
team: React.propTypes.object.isRequired,
user: React.PropTypes.object.isRequired
};
}
render() {
const options = [];
const config = window.mm_config;
const isSystemAdmin = Utils.isSystemAdmin(this.props.user.roles);
if (config.EnableIncomingWebhooks === 'true') {
options.push(
@@ -88,7 +92,7 @@ export default class Integrations extends React.Component {
);
}
if (config.EnableOAuthServiceProvider === 'true') {
if (config.EnableOAuthServiceProvider === 'true' && (isSystemAdmin || config.EnableOnlyAdminIntegrations !== 'true')) {
options.push(
<IntegrationOption
key='oauth2Apps'