ABC-176 Prevent changing PluginSettings.EnableUploads through the API (#8249)

* Prevent changing PluginSettings.EnableUploads through the API

* Contain api4 test case in it's own test
Этот коммит содержится в:
Joram Wilander
2018-02-13 11:08:49 -05:00
коммит произвёл GitHub
родитель d88d2bc2ed
Коммит 5c560db810
4 изменённых файлов: 39 добавлений и 2 удалений

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

@@ -121,6 +121,9 @@ func updateConfig(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
// Do not allow plugin uploads to be toggled through the API
cfg.PluginSettings.EnableUploads = c.App.GetConfig().PluginSettings.EnableUploads
err := c.App.SaveConfig(cfg, true)
if err != nil {
c.Err = err