[MM-38082] Add local-mode handler for config reload endpoint (#18252)
* Add local-mode handler for config reload endpoint * Remove redundant method
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3048f5d435
Коммит
ddfa6e2436
@@ -86,12 +86,15 @@ func configReload(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if *c.App.Config().ExperimentalSettings.RestrictSystemAdmin {
|
||||
if !c.AppContext.Session().IsUnrestricted() && *c.App.Config().ExperimentalSettings.RestrictSystemAdmin {
|
||||
c.Err = model.NewAppError("configReload", "api.restricted_system_admin", nil, "", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
c.App.ReloadConfig()
|
||||
if err := c.App.ReloadConfig(); err != nil {
|
||||
c.Err = model.NewAppError("configReload", "api.config.reload_config.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
auditRec.Success()
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user