diff options
author | George Goldberg <george@gberg.me> | 2017-01-02 22:35:26 +0000 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2017-01-02 19:35:26 -0300 |
commit | e3b8511462552dddabe257ee16d74492fdaedb2c (patch) | |
tree | 2e9224295a5209a269dfa802daa313276a42b10e /webapp/components/navbar.jsx | |
parent | 267257b68055684f8bff94e4ae78d4b9e9c93b0b (diff) | |
download | chat-e3b8511462552dddabe257ee16d74492fdaedb2c.tar.gz chat-e3b8511462552dddabe257ee16d74492fdaedb2c.tar.bz2 chat-e3b8511462552dddabe257ee16d74492fdaedb2c.zip |
PLT-4990 (WebApp): Separate channel management permissions. (#4865)
Diffstat (limited to 'webapp/components/navbar.jsx')
-rw-r--r-- | webapp/components/navbar.jsx | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/webapp/components/navbar.jsx b/webapp/components/navbar.jsx index 07049446d..338d4edd1 100644 --- a/webapp/components/navbar.jsx +++ b/webapp/components/navbar.jsx @@ -222,30 +222,6 @@ export default class Navbar extends React.Component { }); } - showManagementOptions(channel, isAdmin, isSystemAdmin) { - if (global.window.mm_license.IsLicensed !== 'true') { - return true; - } - - if (channel.type === Constants.OPEN_CHANNEL) { - if (global.window.mm_config.RestrictPublicChannelManagement === Constants.PERMISSIONS_SYSTEM_ADMIN && !isSystemAdmin) { - return false; - } - if (global.window.mm_config.RestrictPublicChannelManagement === Constants.PERMISSIONS_TEAM_ADMIN && !isAdmin) { - return false; - } - } else if (channel.type === Constants.PRIVATE_CHANNEL) { - if (global.window.mm_config.RestrictPrivateChannelManagement === Constants.PERMISSIONS_SYSTEM_ADMIN && !isSystemAdmin) { - return false; - } - if (global.window.mm_config.RestrictPrivateChannelManagement === Constants.PERMISSIONS_TEAM_ADMIN && !isAdmin) { - return false; - } - } - - return true; - } - toggleFavorite = (e) => { e.preventDefault(); @@ -388,7 +364,7 @@ export default class Navbar extends React.Component { </li> ); - if (this.showManagementOptions(channel, isAdmin, isSystemAdmin)) { + if (ChannelUtils.showManagementOptions(channel, isAdmin, isSystemAdmin)) { setChannelHeaderOption = ( <li role='presentation'> <a @@ -444,7 +420,7 @@ export default class Navbar extends React.Component { ); } - if (this.showManagementOptions(channel, isAdmin, isSystemAdmin) || this.state.userCount === 1) { + if (ChannelUtils.showDeleteOption(channel, isAdmin, isSystemAdmin) || this.state.userCount === 1) { if (!ChannelStore.isDefault(channel)) { deleteChannelOption = ( <li role='presentation'> |