summaryrefslogtreecommitdiffstats
path: root/model
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 /model
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 'model')
-rw-r--r--model/config.go42
1 files changed, 27 insertions, 15 deletions
diff --git a/model/config.go b/model/config.go
index 32994a279..61c39bc5b 100644
--- a/model/config.go
+++ b/model/config.go
@@ -32,9 +32,9 @@ const (
DIRECT_MESSAGE_ANY = "any"
DIRECT_MESSAGE_TEAM = "team"
- TEAM_INVITE_ALL = "all"
- TEAM_INVITE_TEAM_ADMIN = "team_admin"
- TEAM_INVITE_SYSTEM_ADMIN = "system_admin"
+ PERMISSIONS_ALL = "all"
+ PERMISSIONS_TEAM_ADMIN = "team_admin"
+ PERMISSIONS_SYSTEM_ADMIN = "system_admin"
FAKE_SETTING = "********************************"
@@ -169,17 +169,19 @@ type SupportSettings struct {
}
type TeamSettings struct {
- SiteName string
- MaxUsersPerTeam int
- EnableTeamCreation bool
- EnableUserCreation bool
- EnableOpenServer *bool
- RestrictCreationToDomains string
- RestrictTeamNames *bool
- EnableCustomBrand *bool
- CustomBrandText *string
- RestrictDirectMessage *string
- RestrictTeamInvite *string
+ SiteName string
+ MaxUsersPerTeam int
+ EnableTeamCreation bool
+ EnableUserCreation bool
+ EnableOpenServer *bool
+ RestrictCreationToDomains string
+ RestrictTeamNames *bool
+ EnableCustomBrand *bool
+ CustomBrandText *string
+ RestrictDirectMessage *string
+ RestrictTeamInvite *string
+ RestrictPublicChannelManagement *string
+ RestrictPrivateChannelManagement *string
}
type LdapSettings struct {
@@ -381,7 +383,17 @@ func (o *Config) SetDefaults() {
if o.TeamSettings.RestrictTeamInvite == nil {
o.TeamSettings.RestrictTeamInvite = new(string)
- *o.TeamSettings.RestrictTeamInvite = TEAM_INVITE_ALL
+ *o.TeamSettings.RestrictTeamInvite = PERMISSIONS_ALL
+ }
+
+ if o.TeamSettings.RestrictPublicChannelManagement == nil {
+ o.TeamSettings.RestrictPublicChannelManagement = new(string)
+ *o.TeamSettings.RestrictPublicChannelManagement = PERMISSIONS_ALL
+ }
+
+ if o.TeamSettings.RestrictPrivateChannelManagement == nil {
+ o.TeamSettings.RestrictPrivateChannelManagement = new(string)
+ *o.TeamSettings.RestrictPrivateChannelManagement = PERMISSIONS_ALL
}
if o.EmailSettings.EnableSignInWithEmail == nil {