api4/system: adjust permissions for applied schema migrations (#19814)
* api4/system: adjust permissions for applied schema migrations * add a test case
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2385bbdd50
Коммит
ad5f57b161
@@ -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)
|
||||
|
||||
Ссылка в новой задаче
Block a user