summaryrefslogtreecommitdiffstats
path: root/webapp/components/integrations/components/installed_outgoing_webhooks.jsx
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-12-06 07:35:24 -0500
committerenahum <nahumhbl@gmail.com>2016-12-06 09:35:24 -0300
commit83a2bbe67ae12b6ffd03bed9eeb87e93444356e2 (patch)
tree5d387d5dfc9944549cb16871e8a302fab9f4b9f6 /webapp/components/integrations/components/installed_outgoing_webhooks.jsx
parent6ae028d2c6695b5e9d2ae829217c6a6fafc6eb0c (diff)
downloadchat-83a2bbe67ae12b6ffd03bed9eeb87e93444356e2.tar.gz
chat-83a2bbe67ae12b6ffd03bed9eeb87e93444356e2.tar.bz2
chat-83a2bbe67ae12b6ffd03bed9eeb87e93444356e2.zip
Only show edit/delete buttons for integrations if the user should have permissions to them (#4719)
Diffstat (limited to 'webapp/components/integrations/components/installed_outgoing_webhooks.jsx')
-rw-r--r--webapp/components/integrations/components/installed_outgoing_webhooks.jsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/webapp/components/integrations/components/installed_outgoing_webhooks.jsx b/webapp/components/integrations/components/installed_outgoing_webhooks.jsx
index 4e9a0260f..7f278d112 100644
--- a/webapp/components/integrations/components/installed_outgoing_webhooks.jsx
+++ b/webapp/components/integrations/components/installed_outgoing_webhooks.jsx
@@ -19,7 +19,9 @@ import {FormattedMessage} from 'react-intl';
export default class InstalledOutgoingWebhooks extends React.Component {
static get propTypes() {
return {
- team: React.PropTypes.object
+ team: React.PropTypes.object,
+ user: React.PropTypes.object,
+ isAdmin: React.PropTypes.bool
};
}
@@ -77,6 +79,8 @@ export default class InstalledOutgoingWebhooks extends React.Component {
render() {
const outgoingWebhooks = this.state.outgoingWebhooks.map((outgoingWebhook) => {
+ const canChange = this.props.isAdmin || this.props.user.id === outgoingWebhook.creator_id;
+
return (
<InstalledOutgoingWebhook
key={outgoingWebhook.id}
@@ -84,6 +88,7 @@ export default class InstalledOutgoingWebhooks extends React.Component {
onRegenToken={this.regenOutgoingWebhookToken}
onDelete={this.deleteOutgoingWebhook}
creator={this.state.users[outgoingWebhook.creator_id] || {}}
+ canChange={canChange}
/>
);
});