summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2016-12-21 19:18:41 +0000
committerCorey Hulen <corey@hulen.com>2016-12-21 11:18:41 -0800
commitdce4205699bed68046f9dc6ed371ad959d93ee59 (patch)
tree7bd2d857ee9786ec59b782c52ffc5f59c0853728 /model
parentf0f53260984a210f44458d86ed5ac9e3afb3f363 (diff)
downloadchat-dce4205699bed68046f9dc6ed371ad959d93ee59.tar.gz
chat-dce4205699bed68046f9dc6ed371ad959d93ee59.tar.bz2
chat-dce4205699bed68046f9dc6ed371ad959d93ee59.zip
PLT-4990 - Server: Split out channel permissions to Create/Manage/Delete (#4864)
* Server side changes. * Fix unit tests and default config.
Diffstat (limited to 'model')
-rw-r--r--model/config.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go
index 0a3fcb33e..29fa995fd 100644
--- a/model/config.go
+++ b/model/config.go
@@ -226,6 +226,10 @@ type TeamSettings struct {
RestrictTeamInvite *string
RestrictPublicChannelManagement *string
RestrictPrivateChannelManagement *string
+ RestrictPublicChannelCreation *string
+ RestrictPrivateChannelCreation *string
+ RestrictPublicChannelDeletion *string
+ RestrictPrivateChannelDeletion *string
UserStatusAwayTimeout *int64
MaxChannelsPerTeam *int64
MaxNotificationsPerChannel *int64
@@ -507,6 +511,30 @@ func (o *Config) SetDefaults() {
*o.TeamSettings.RestrictPrivateChannelManagement = PERMISSIONS_ALL
}
+ if o.TeamSettings.RestrictPublicChannelCreation == nil {
+ o.TeamSettings.RestrictPublicChannelCreation = new(string)
+ // If this setting does not exist, assume migration from <3.6, so use management setting as default.
+ *o.TeamSettings.RestrictPublicChannelCreation = *o.TeamSettings.RestrictPublicChannelManagement
+ }
+
+ if o.TeamSettings.RestrictPrivateChannelCreation == nil {
+ o.TeamSettings.RestrictPrivateChannelCreation = new(string)
+ // If this setting does not exist, assume migration from <3.6, so use management setting as default.
+ *o.TeamSettings.RestrictPrivateChannelCreation = *o.TeamSettings.RestrictPrivateChannelManagement
+ }
+
+ if o.TeamSettings.RestrictPublicChannelDeletion == nil {
+ o.TeamSettings.RestrictPublicChannelDeletion = new(string)
+ // If this setting does not exist, assume migration from <3.6, so use management setting as default.
+ *o.TeamSettings.RestrictPublicChannelDeletion = *o.TeamSettings.RestrictPublicChannelManagement
+ }
+
+ if o.TeamSettings.RestrictPrivateChannelDeletion == nil {
+ o.TeamSettings.RestrictPrivateChannelDeletion = new(string)
+ // If this setting does not exist, assume migration from <3.6, so use management setting as default.
+ *o.TeamSettings.RestrictPrivateChannelDeletion = *o.TeamSettings.RestrictPrivateChannelManagement
+ }
+
if o.TeamSettings.UserStatusAwayTimeout == nil {
o.TeamSettings.UserStatusAwayTimeout = new(int64)
*o.TeamSettings.UserStatusAwayTimeout = 300