[MM-41147] Remove cloud sysadmin access to migrate config API (#19373)
* remove cloud sysadmin access to migrate config API * reflect review comments * Update i18n/en.json Co-authored-by: Claudio Costa <cstcld91@gmail.com> Co-authored-by: Claudio Costa <cstcld91@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9fde5b1ac3
Коммит
0b46264426
@@ -407,6 +407,12 @@ func migrateConfig(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
isCloud := c.App.Srv().License() != nil && *c.App.Srv().License().Features.Cloud
|
||||
if isCloud {
|
||||
c.Err = model.NewAppError("migrateConfig", "api.config.migrate_config_restricted.app_error", nil, "", http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
|
||||
err := config.Migrate(from, to)
|
||||
if err != nil {
|
||||
c.Err = model.NewAppError("migrateConfig", "api.config.migrate_config.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
|
||||
Ссылка в новой задаче
Block a user