MM-39918: mmctl: list archived private channels in channel list command with system admin user (#28676)

Этот коммит содержится в:
Nicolas Le Cam
2024-11-07 12:07:30 +01:00
коммит произвёл GitHub
родитель 7846ac86b4
Коммит 5ebdea506f
12 изменённых файлов: 95 добавлений и 61 удалений

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

@@ -897,7 +897,8 @@ func getDeletedChannelsForTeam(c *Context, w http.ResponseWriter, r *http.Reques
return
}
channels, err := c.App.GetDeletedChannels(c.AppContext, c.Params.TeamId, c.Params.Page*c.Params.PerPage, c.Params.PerPage, c.AppContext.Session().UserId)
skipTeamMembershipCheck := c.App.SessionHasPermissionTo(*c.AppContext.Session(), model.PermissionManageSystem)
channels, err := c.App.GetDeletedChannels(c.AppContext, c.Params.TeamId, c.Params.Page*c.Params.PerPage, c.Params.PerPage, c.AppContext.Session().UserId, skipTeamMembershipCheck)
if err != nil {
c.Err = err
return

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

@@ -959,7 +959,8 @@ func TestGetDeletedChannelsForTeam(t *testing.T) {
th.TestForSystemAdminAndLocal(t, func(t *testing.T, client *model.Client4) {
channels, _, err = client.GetDeletedChannelsForTeam(context.Background(), team.Id, 0, 100, "")
require.NoError(t, err)
require.Len(t, channels, numInitialChannelsForTeam+2)
// Local admin should see private archived channels
require.Len(t, channels, numInitialChannelsForTeam+4)
})
channels, _, err = client.GetDeletedChannelsForTeam(context.Background(), team.Id, 0, 1, "")