[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>
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-01-19 23:05:32 +03:00
коммит произвёл GitHub
родитель 9fde5b1ac3
Коммит 0b46264426
4 изменённых файлов: 58 добавлений и 1 удалений

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

@@ -787,4 +787,20 @@ func TestMigrateConfig(t *testing.T) {
_, err = client.MigrateConfig("from.json", "to.json")
require.NoError(t, err)
})
t.Run("Cloud instances should not access to this API", func(t *testing.T) {
require.True(t, th.App.Srv().SetLicense(model.NewTestLicense("cloud")))
f, err := config.NewStoreFromDSN("from.json", false, nil)
require.NoError(t, err)
defer f.RemoveFile("from.json")
_, err = config.NewStoreFromDSN("to.json", false, nil)
require.NoError(t, err)
defer f.RemoveFile("to.json")
response, cErr := th.SystemAdminClient.MigrateConfig("from.json", "to.json")
require.Error(t, cErr)
CheckForbiddenStatus(t, response)
})
}