PLT-4007 Fix OAuth: Javascript error when team admin accesses the OAuth 2.0 menu (#3887)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
1326ab66a1
Коммит
db660bdf9c
@@ -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'
|
||||
|
||||
Ссылка в новой задаче
Block a user