diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-12-06 07:35:24 -0500 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2016-12-06 09:35:24 -0300 |
commit | 83a2bbe67ae12b6ffd03bed9eeb87e93444356e2 (patch) | |
tree | 5d387d5dfc9944549cb16871e8a302fab9f4b9f6 /webapp/components/integrations/components/installed_commands.jsx | |
parent | 6ae028d2c6695b5e9d2ae829217c6a6fafc6eb0c (diff) | |
download | chat-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_commands.jsx')
-rw-r--r-- | webapp/components/integrations/components/installed_commands.jsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/webapp/components/integrations/components/installed_commands.jsx b/webapp/components/integrations/components/installed_commands.jsx index e080cd706..1854e6eb1 100644 --- a/webapp/components/integrations/components/installed_commands.jsx +++ b/webapp/components/integrations/components/installed_commands.jsx @@ -14,9 +14,11 @@ export default class InstalledCommands extends React.Component { static get propTypes() { return { team: React.PropTypes.object, + user: React.PropTypes.object, users: React.PropTypes.object, commands: React.PropTypes.array, - loading: React.PropTypes.bool + loading: React.PropTypes.bool, + isAdmin: React.PropTypes.bool }; } @@ -37,6 +39,8 @@ export default class InstalledCommands extends React.Component { render() { const commands = this.props.commands.map((command) => { + const canChange = this.props.isAdmin || this.props.user.id === command.creator_id; + return ( <InstalledCommand key={command.id} @@ -45,6 +49,7 @@ export default class InstalledCommands extends React.Component { onRegenToken={this.regenCommandToken} onDelete={this.deleteCommand} creator={this.props.users[command.creator_id] || {}} + canChange={canChange} /> ); }); |