From 3c5280119357e3742811fd724601d0bef01bcb29 Mon Sep 17 00:00:00 2001 From: David Meza Date: Fri, 1 Sep 2017 08:53:55 -0500 Subject: Config to make town square read only (#7140) * Be able to make Town Square read-only (Disable typing messages for non admins). * Do not emit UserTypingEvent when TownSquareIsReadOnly and is Town Square. * Add unit tests for TownSquareIsReadOnly config value and logic. * Add TownSquareIsReadOnly to System console>Policy. Added Telemetry. * Add control for TownSquareIsReadOnly=true only for License Enterprise Edition E10 & E20. * Update en.json * Update en.json * Update policy_settings.jsx * Change config value from TownSquareIsReadOnly to ExperimentalTownSquareIsReadOnly. * Refactored to simplify. Avoid code repeat and multiple db calls. --- model/config.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'model') diff --git a/model/config.go b/model/config.go index 65608c9a5..58b3da4d1 100644 --- a/model/config.go +++ b/model/config.go @@ -354,6 +354,7 @@ type TeamSettings struct { MaxChannelsPerTeam *int64 MaxNotificationsPerChannel *int64 TeammateNameDisplay *string + ExperimentalTownSquareIsReadOnly *bool } type ClientRequirements struct { @@ -824,6 +825,11 @@ func (o *Config) SetDefaults() { *o.TeamSettings.MaxNotificationsPerChannel = 1000 } + if o.TeamSettings.ExperimentalTownSquareIsReadOnly == nil { + o.TeamSettings.ExperimentalTownSquareIsReadOnly = new(bool) + *o.TeamSettings.ExperimentalTownSquareIsReadOnly = false + } + if o.EmailSettings.EnableSignInWithEmail == nil { o.EmailSettings.EnableSignInWithEmail = new(bool) -- cgit v1.2.3-1-g7c22