summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-07-06 08:23:24 -0400
committerGitHub <noreply@github.com>2016-07-06 08:23:24 -0400
commit5f7cb8cfbf879aa0b0d43a7b7068688368fda9fc (patch)
tree555f578f1346d0b18448176ce1dc2a4771f16c6a /webapp/components/admin_console
parent19d452c74efb96f718079d5a268ca51a8983c4bd (diff)
downloadchat-5f7cb8cfbf879aa0b0d43a7b7068688368fda9fc.tar.gz
chat-5f7cb8cfbf879aa0b0d43a7b7068688368fda9fc.tar.bz2
chat-5f7cb8cfbf879aa0b0d43a7b7068688368fda9fc.zip
PLT-3346/PLT-3342/PLT-3360 EE: Add the ability to restrict channel management permissions (#3453)
* EE: Add the ability to restrict channel management permissions * Always allow last user in a channel to delete that channel
Diffstat (limited to 'webapp/components/admin_console')
-rw-r--r--webapp/components/admin_console/policy_settings.jsx56
1 files changed, 52 insertions, 4 deletions
diff --git a/webapp/components/admin_console/policy_settings.jsx b/webapp/components/admin_console/policy_settings.jsx
index 7fe8e9460..c7031af7b 100644
--- a/webapp/components/admin_console/policy_settings.jsx
+++ b/webapp/components/admin_console/policy_settings.jsx
@@ -21,12 +21,16 @@ export default class PolicySettings extends AdminSettings {
this.renderSettings = this.renderSettings.bind(this);
this.state = Object.assign(this.state, {
- restrictTeamInvite: props.config.TeamSettings.RestrictTeamInvite
+ restrictTeamInvite: props.config.TeamSettings.RestrictTeamInvite,
+ restrictPublicChannelManagement: props.config.TeamSettings.RestrictPublicChannelManagement,
+ restrictPrivateChannelManagement: props.config.TeamSettings.RestrictPrivateChannelManagement
});
}
getConfigFromState(config) {
config.TeamSettings.RestrictTeamInvite = this.state.restrictTeamInvite;
+ config.TeamSettings.RestrictPublicChannelManagement = this.state.restrictPublicChannelManagement;
+ config.TeamSettings.RestrictPrivateChannelManagement = this.state.restrictPrivateChannelManagement;
return config;
}
@@ -48,9 +52,9 @@ export default class PolicySettings extends AdminSettings {
<DropdownSetting
id='restrictTeamInvite'
values={[
- {value: Constants.TEAM_INVITE_ALL, text: Utils.localizeMessage('admin.general.policy.teamInviteAll', 'All team members')},
- {value: Constants.TEAM_INVITE_TEAM_ADMIN, text: Utils.localizeMessage('admin.general.policy.teamInviteAdmin', 'Team and System Admins')},
- {value: Constants.TEAM_INVITE_SYSTEM_ADMIN, text: Utils.localizeMessage('admin.general.policy.teamInviteSystemAdmin', 'System Admins')}
+ {value: Constants.PERMISSIONS_ALL, text: Utils.localizeMessage('admin.general.policy.permissionsAll', 'All team members')},
+ {value: Constants.PERMISSIONS_TEAM_ADMIN, text: Utils.localizeMessage('admin.general.policy.permissionsAdmin', 'Team and System Admins')},
+ {value: Constants.PERMISSIONS_SYSTEM_ADMIN, text: Utils.localizeMessage('admin.general.policy.permissionsSystemAdmin', 'System Admins')}
]}
label={
<FormattedMessage
@@ -67,6 +71,50 @@ export default class PolicySettings extends AdminSettings {
/>
}
/>
+ <DropdownSetting
+ id='restrictPublicChannelManagement'
+ values={[
+ {value: Constants.PERMISSIONS_ALL, text: Utils.localizeMessage('admin.general.policy.permissionsAll', 'All team members')},
+ {value: Constants.PERMISSIONS_TEAM_ADMIN, text: Utils.localizeMessage('admin.general.policy.permissionsAdmin', 'Team and System Admins')},
+ {value: Constants.PERMISSIONS_SYSTEM_ADMIN, text: Utils.localizeMessage('admin.general.policy.permissionsSystemAdmin', 'System Admins')}
+ ]}
+ label={
+ <FormattedMessage
+ id='admin.general.policy.restrictPublicChannelManagementTitle'
+ defaultMessage='Enable public channel management permissions for:'
+ />
+ }
+ value={this.state.restrictPublicChannelManagement}
+ onChange={this.handleChange}
+ helpText={
+ <FormattedHTMLMessage
+ id='admin.general.policy.restrictPublicChannelManagementDescription'
+ defaultMessage='Selecting "All team members" allows any team members to create, delete, rename, and set the header or purpose for public channels.<br/><br/>Selecting "Team and System Admins" restricts channel management permissions for public channels to Team and System Admins, including creating, deleting, renaming, and setting the channel header or purpose.<br/><br/>Selecting "System Admins" restricts channel management permissions for public channels to System Admins, including creating, deleting, renaming, and setting the channel header or purpose.'
+ />
+ }
+ />
+ <DropdownSetting
+ id='restrictPrivateChannelManagement'
+ values={[
+ {value: Constants.PERMISSIONS_ALL, text: Utils.localizeMessage('admin.general.policy.permissionsAll', 'All team members')},
+ {value: Constants.PERMISSIONS_TEAM_ADMIN, text: Utils.localizeMessage('admin.general.policy.permissionsAdmin', 'Team and System Admins')},
+ {value: Constants.PERMISSIONS_SYSTEM_ADMIN, text: Utils.localizeMessage('admin.general.policy.permissionsSystemAdmin', 'System Admins')}
+ ]}
+ label={
+ <FormattedMessage
+ id='admin.general.policy.restrictPrivateChannelManagementTitle'
+ defaultMessage='Enable private group management permissions for:'
+ />
+ }
+ value={this.state.restrictPrivateChannelManagement}
+ onChange={this.handleChange}
+ helpText={
+ <FormattedHTMLMessage
+ id='admin.general.policy.restrictPrivateChannelManagementDescription'
+ defaultMessage='Selecting "All team members" allows any team members to create, delete, rename, and set the header or purpose for private groups.<br/><br/>Selecting "Team and System Admins" restricts group management permissions for private groups to Team and System Admins, including creating, deleting, renaming, and setting the group header or purpose.<br/><br/>Selecting "System Admins" restricts group management permissions for private groups to System Admins, including creating, deleting, renaming, and setting the group header or purpose.'
+ />
+ }
+ />
</SettingsGroup>
);
}