summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-06-05 16:34:43 -0400
committerJoram Wilander <jwawilander@gmail.com>2017-06-05 16:34:42 -0400
commita3171048e089fba22360e90fe5312be344ab1739 (patch)
tree2a2a3b4f021454c516260ea44b61030d022d3e7c /webapp
parentdb1b202e421fd46a183a3fe8fdcf710e3d62a0a3 (diff)
downloadchat-a3171048e089fba22360e90fe5312be344ab1739.tar.gz
chat-a3171048e089fba22360e90fe5312be344ab1739.tar.bz2
chat-a3171048e089fba22360e90fe5312be344ab1739.zip
PLT-6724 Hide options relating to channel admin when not licensed (#6583)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/channel_members_dropdown/channel_members_dropdown.jsx20
-rw-r--r--webapp/utils/utils.jsx4
2 files changed, 11 insertions, 13 deletions
diff --git a/webapp/components/channel_members_dropdown/channel_members_dropdown.jsx b/webapp/components/channel_members_dropdown/channel_members_dropdown.jsx
index c327f9f81..86efc8367 100644
--- a/webapp/components/channel_members_dropdown/channel_members_dropdown.jsx
+++ b/webapp/components/channel_members_dropdown/channel_members_dropdown.jsx
@@ -80,15 +80,6 @@ export default class ChannelMembersDropdown extends React.Component {
);
}
- // Checks if the user this menu is for is a channel admin or not.
- isChannelAdmin() {
- if (Utils.isChannelAdmin(this.props.channelMember.roles)) {
- return true;
- }
-
- return false;
- }
-
// Checks if the current user has the power to change the roles of this member.
canChangeMemberRoles() {
if (UserStore.isSystemAdminForCurrentUser()) {
@@ -108,6 +99,9 @@ export default class ChannelMembersDropdown extends React.Component {
}
render() {
+ const supportsChannelAdmin = global.mm_license.IsLicensed === 'true';
+ const isChannelAdmin = supportsChannelAdmin && Utils.isChannelAdmin(this.props.channelMember.roles);
+
let serverError = null;
if (this.state.serverError) {
serverError = (
@@ -129,7 +123,7 @@ export default class ChannelMembersDropdown extends React.Component {
/>
);
- if (this.isChannelAdmin()) {
+ if (isChannelAdmin) {
role = (
<FormattedMessage
id='channel_members_dropdown.channel_admin'
@@ -158,7 +152,7 @@ export default class ChannelMembersDropdown extends React.Component {
}
let makeChannelMember = null;
- if (this.isChannelAdmin()) {
+ if (isChannelAdmin) {
makeChannelMember = (
<li role='presentation'>
<a
@@ -177,7 +171,7 @@ export default class ChannelMembersDropdown extends React.Component {
}
let makeChannelAdmin = null;
- if (!this.isChannelAdmin()) {
+ if (supportsChannelAdmin && !isChannelAdmin) {
makeChannelAdmin = (
<li role='presentation'>
<a
@@ -233,7 +227,7 @@ export default class ChannelMembersDropdown extends React.Component {
/>
</button>
);
- } else if (this.isChannelAdmin()) {
+ } else if (isChannelAdmin) {
if (this.props.channel.name === Constants.DEFAULT_CHANNEL) {
return (
<div/>
diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx
index 469f793c8..2b685a793 100644
--- a/webapp/utils/utils.jsx
+++ b/webapp/utils/utils.jsx
@@ -66,6 +66,10 @@ export function isInRole(roles, inRole) {
}
export function isChannelAdmin(roles) {
+ if (global.mm_license.IsLicensed !== 'true') {
+ return false;
+ }
+
if (isInRole(roles, 'channel_admin')) {
return true;
}