From a43928cca82c718dd378961102a3766b3e354ac8 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 13 Feb 2018 11:08:49 -0500 Subject: 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 --- api/admin.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'api/admin.go') diff --git a/api/admin.go b/api/admin.go index b3b74d5ea..3b58650cc 100644 --- a/api/admin.go +++ b/api/admin.go @@ -108,6 +108,9 @@ func saveConfig(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 -- cgit v1.2.3-1-g7c22