Allow admins to change the display name for the default channel

Этот коммит содержится в:
Reed Garmsen
2015-11-13 16:22:32 -08:00
родитель f0b1adf6cf
Коммит eacc06c7fc
5 изменённых файлов: 92 добавлений и 68 удалений

Просмотреть файл

@@ -205,9 +205,11 @@ func updateChannel(c *Context, w http.ResponseWriter, r *http.Request) {
}
if oldChannel.Name == model.DEFAULT_CHANNEL {
c.Err = model.NewAppError("updateChannel", "Cannot update the default channel "+model.DEFAULT_CHANNEL, "")
c.Err.StatusCode = http.StatusForbidden
return
if (len(channel.Name) > 0 && channel.Name != oldChannel.Name) || (len(channel.Type) > 0 && channel.Type != oldChannel.Type) {
c.Err = model.NewAppError("updateChannel", "Tried to perform an invalid update of the default channel "+model.DEFAULT_CHANNEL, "")
c.Err.StatusCode = http.StatusForbidden
return
}
}
oldChannel.Header = channel.Header