PLT-7849 Add config setting to disable plugin uploads (#7666)

* Add config setting to disable plugin uploads

* Update unit test
Этот коммит содержится в:
Joram Wilander
2017-10-25 08:52:50 -04:00
коммит произвёл GitHub
родитель 5474cff0eb
Коммит 1d968eb55e
5 изменённых файлов: 34 добавлений и 10 удалений

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

@@ -32,8 +32,8 @@ func (api *API) InitPlugin() {
}
func uploadPlugin(c *Context, w http.ResponseWriter, r *http.Request) {
if !*c.App.Config().PluginSettings.Enable {
c.Err = model.NewAppError("uploadPlugin", "app.plugin.disabled.app_error", nil, "", http.StatusNotImplemented)
if !*c.App.Config().PluginSettings.Enable || !*c.App.Config().PluginSettings.EnableUploads {
c.Err = model.NewAppError("uploadPlugin", "app.plugin.upload_disabled.app_error", nil, "", http.StatusNotImplemented)
return
}