api4/system: adjust permissions for applied schema migrations (#19814)

* api4/system: adjust permissions for applied schema migrations

* add a test case
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-03-23 19:34:03 +03:00
коммит произвёл GitHub
родитель 2385bbdd50
Коммит ad5f57b161
8 изменённых файлов: 12 добавлений и 26 удалений

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

@@ -942,6 +942,16 @@ func TestGetAppliedSchemaMigrations(t *testing.T) {
CheckForbiddenStatus(t, resp)
})
t.Run("as a system manager role", func(t *testing.T) {
_, appErr := th.App.UpdateUserRoles(th.BasicUser2.Id, model.SystemManagerRoleId, false)
require.Nil(t, appErr)
th.LoginBasic2()
_, resp, err := th.Client.GetAppliedSchemaMigrations()
require.NoError(t, err)
CheckOKStatus(t, resp)
})
th.TestForSystemAdminAndLocal(t, func(t *testing.T, c *model.Client4) {
_, resp, err := c.GetAppliedSchemaMigrations()
require.NoError(t, err)