PLT-6152: Set Header in channel intro obeys permissions. (#6156)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
c94754e94f
Коммит
430e93dfc1
@@ -14,6 +14,8 @@ import * as GlobalActions from 'actions/global_actions.jsx';
|
|||||||
import Client from 'client/web_client.jsx';
|
import Client from 'client/web_client.jsx';
|
||||||
import ProfilePicture from 'components/profile_picture.jsx';
|
import ProfilePicture from 'components/profile_picture.jsx';
|
||||||
|
|
||||||
|
import {showManagementOptions} from './channel_utils.jsx';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {FormattedMessage, FormattedHTMLMessage, FormattedDate} from 'react-intl';
|
import {FormattedMessage, FormattedHTMLMessage, FormattedDate} from 'react-intl';
|
||||||
|
|
||||||
@@ -157,6 +159,15 @@ export function createOffTopicIntroMessage(channel, centeredIntro) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
|
||||||
|
const isSystemAdmin = UserStore.isSystemAdminForCurrentUser();
|
||||||
|
const isChannelAdmin = ChannelStore.isChannelAdminForCurrentChannel();
|
||||||
|
|
||||||
|
let setHeaderButton = createSetHeaderButton(channel);
|
||||||
|
if (!showManagementOptions(channel, isAdmin, isSystemAdmin, isChannelAdmin)) {
|
||||||
|
setHeaderButton = null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={'channel-intro ' + centeredIntro}>
|
<div className={'channel-intro ' + centeredIntro}>
|
||||||
<FormattedHTMLMessage
|
<FormattedHTMLMessage
|
||||||
@@ -167,7 +178,7 @@ export function createOffTopicIntroMessage(channel, centeredIntro) {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{createInviteChannelMemberButton(channel, uiType)}
|
{createInviteChannelMemberButton(channel, uiType)}
|
||||||
{createSetHeaderButton(channel)}
|
{setHeaderButton}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -189,6 +200,7 @@ export function createDefaultIntroMessage(channel, centeredIntro) {
|
|||||||
|
|
||||||
const isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
|
const isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
|
||||||
const isSystemAdmin = UserStore.isSystemAdminForCurrentUser();
|
const isSystemAdmin = UserStore.isSystemAdminForCurrentUser();
|
||||||
|
const isChannelAdmin = ChannelStore.isChannelAdminForCurrentChannel();
|
||||||
|
|
||||||
if (global.window.mm_license.IsLicensed === 'true') {
|
if (global.window.mm_license.IsLicensed === 'true') {
|
||||||
if (global.window.mm_config.RestrictTeamInvite === Constants.PERMISSIONS_SYSTEM_ADMIN && !isSystemAdmin) {
|
if (global.window.mm_config.RestrictTeamInvite === Constants.PERMISSIONS_SYSTEM_ADMIN && !isSystemAdmin) {
|
||||||
@@ -198,6 +210,11 @@ export function createDefaultIntroMessage(channel, centeredIntro) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let setHeaderButton = createSetHeaderButton(channel);
|
||||||
|
if (!showManagementOptions(channel, isAdmin, isSystemAdmin, isChannelAdmin)) {
|
||||||
|
setHeaderButton = null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={'channel-intro ' + centeredIntro}>
|
<div className={'channel-intro ' + centeredIntro}>
|
||||||
<FormattedHTMLMessage
|
<FormattedHTMLMessage
|
||||||
@@ -208,7 +225,7 @@ export function createDefaultIntroMessage(channel, centeredIntro) {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{inviteModalLink}
|
{inviteModalLink}
|
||||||
{createSetHeaderButton(channel)}
|
{setHeaderButton}
|
||||||
<br/>
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -303,6 +320,15 @@ export function createStandardIntroMessage(channel, centeredIntro) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
|
||||||
|
const isSystemAdmin = UserStore.isSystemAdminForCurrentUser();
|
||||||
|
const isChannelAdmin = ChannelStore.isChannelAdminForCurrentChannel();
|
||||||
|
|
||||||
|
let setHeaderButton = createSetHeaderButton(channel);
|
||||||
|
if (!showManagementOptions(channel, isAdmin, isSystemAdmin, isChannelAdmin)) {
|
||||||
|
setHeaderButton = null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={'channel-intro ' + centeredIntro}>
|
<div className={'channel-intro ' + centeredIntro}>
|
||||||
<h4 className='channel-intro__title'>
|
<h4 className='channel-intro__title'>
|
||||||
@@ -321,7 +347,7 @@ export function createStandardIntroMessage(channel, centeredIntro) {
|
|||||||
<br/>
|
<br/>
|
||||||
</p>
|
</p>
|
||||||
{createInviteChannelMemberButton(channel, uiType)}
|
{createInviteChannelMemberButton(channel, uiType)}
|
||||||
{createSetHeaderButton(channel)}
|
{setHeaderButton}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user