diff options
author | Amit Yadav <iit.amit@gmail.com> | 2017-01-18 18:38:31 +0530 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-01-18 08:08:31 -0500 |
commit | 99cf08ac38bdee25d07f27a3d9bb5d74199d106c (patch) | |
tree | e85ca087c2ec1b6bfe859d509b0f9e5c1a991630 /model/config.go | |
parent | 8f0175e15c4d6bd08ca6795851455468811c3dc9 (diff) | |
download | chat-99cf08ac38bdee25d07f27a3d9bb5d74199d106c.tar.gz chat-99cf08ac38bdee25d07f27a3d9bb5d74199d106c.tar.bz2 chat-99cf08ac38bdee25d07f27a3d9bb5d74199d106c.zip |
Message Editing and Deleting permissions (#4692)
Diffstat (limited to 'model/config.go')
-rw-r--r-- | model/config.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go index 0134e1a34..13e795170 100644 --- a/model/config.go +++ b/model/config.go @@ -49,6 +49,14 @@ const ( RESTRICT_EMOJI_CREATION_ADMIN = "admin" RESTRICT_EMOJI_CREATION_SYSTEM_ADMIN = "system_admin" + PERMISSIONS_DELETE_POST_ALL = "all" + PERMISSIONS_DELETE_POST_TEAM_ADMIN = "team_admin" + PERMISSIONS_DELETE_POST_SYSTEM_ADMIN = "system_admin" + + ALLOW_EDIT_POST_ALWAYS = "always" + ALLOW_EDIT_POST_NEVER = "never" + ALLOW_EDIT_POST_TIME_LIMIT = "time_limit" + EMAIL_BATCHING_BUFFER_SIZE = 256 EMAIL_BATCHING_INTERVAL = 30 @@ -92,6 +100,9 @@ type ServiceSettings struct { WebserverMode *string EnableCustomEmoji *bool RestrictCustomEmojiCreation *string + RestrictPostDelete *string + AllowEditPost *string + PostEditTimeLimit *int } type ClusterSettings struct { @@ -827,6 +838,21 @@ func (o *Config) SetDefaults() { *o.ServiceSettings.RestrictCustomEmojiCreation = RESTRICT_EMOJI_CREATION_ALL } + if o.ServiceSettings.RestrictPostDelete == nil { + o.ServiceSettings.RestrictPostDelete = new(string) + *o.ServiceSettings.RestrictPostDelete = PERMISSIONS_DELETE_POST_ALL + } + + if o.ServiceSettings.AllowEditPost == nil { + o.ServiceSettings.AllowEditPost = new(string) + *o.ServiceSettings.AllowEditPost = ALLOW_EDIT_POST_TIME_LIMIT + } + + if o.ServiceSettings.PostEditTimeLimit == nil { + o.ServiceSettings.PostEditTimeLimit = new(int) + *o.ServiceSettings.PostEditTimeLimit = 300 + } + if o.ClusterSettings.InterNodeListenAddress == nil { o.ClusterSettings.InterNodeListenAddress = new(string) *o.ClusterSettings.InterNodeListenAddress = ":8075" |