[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
@@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user