summaryrefslogtreecommitdiffstats
path: root/webapp/components/new_channel_modal.jsx
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-01-02 22:35:26 +0000
committerenahum <nahumhbl@gmail.com>2017-01-02 19:35:26 -0300
commite3b8511462552dddabe257ee16d74492fdaedb2c (patch)
tree2e9224295a5209a269dfa802daa313276a42b10e /webapp/components/new_channel_modal.jsx
parent267257b68055684f8bff94e4ae78d4b9e9c93b0b (diff)
downloadchat-e3b8511462552dddabe257ee16d74492fdaedb2c.tar.gz
chat-e3b8511462552dddabe257ee16d74492fdaedb2c.tar.bz2
chat-e3b8511462552dddabe257ee16d74492fdaedb2c.zip
PLT-4990 (WebApp): Separate channel management permissions. (#4865)
Diffstat (limited to 'webapp/components/new_channel_modal.jsx')
-rw-r--r--webapp/components/new_channel_modal.jsx19
1 files changed, 7 insertions, 12 deletions
diff --git a/webapp/components/new_channel_modal.jsx b/webapp/components/new_channel_modal.jsx
index 2a7d93b0c..fc9fd0295 100644
--- a/webapp/components/new_channel_modal.jsx
+++ b/webapp/components/new_channel_modal.jsx
@@ -6,6 +6,7 @@ import ReactDOM from 'react-dom';
import * as UserAgent from 'utils/user_agent.jsx';
import * as Utils from 'utils/utils.jsx';
+import * as ChannelUtils from 'utils/channel_utils.jsx';
import Constants from 'utils/constants.jsx';
import UserStore from 'stores/user_store.jsx';
@@ -141,18 +142,12 @@ export default class NewChannelModal extends React.Component {
const isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
const isSystemAdmin = UserStore.isSystemAdminForCurrentUser();
- if (global.window.mm_license.IsLicensed === 'true') {
- if (global.window.mm_config.RestrictPublicChannelManagement === Constants.PERMISSIONS_SYSTEM_ADMIN && !isSystemAdmin) {
- createPublicChannelLink = null;
- } else if (global.window.mm_config.RestrictPublicChannelManagement === Constants.PERMISSIONS_TEAM_ADMIN && !isAdmin) {
- createPublicChannelLink = null;
- }
-
- if (global.window.mm_config.RestrictPrivateChannelManagement === Constants.PERMISSIONS_SYSTEM_ADMIN && !isSystemAdmin) {
- createPrivateChannelLink = null;
- } else if (global.window.mm_config.RestrictPrivateChannelManagement === Constants.PERMISSIONS_TEAM_ADMIN && !isAdmin) {
- createPrivateChannelLink = null;
- }
+ if (!ChannelUtils.showCreateOption(Constants.OPEN_CHANNEL, isAdmin, isSystemAdmin)) {
+ createPublicChannelLink = null;
+ }
+
+ if (!ChannelUtils.showCreateOption(Constants.PRIVATE_CHANNEL, isAdmin, isSystemAdmin)) {
+ createPrivateChannelLink = null;
}
var channelTerm = '';