MM-39918: mmctl: list archived private channels in channel list command with system admin user (#28676)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7846ac86b4
Коммит
5ebdea506f
@@ -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, "")
|
||||
|
||||
Ссылка в новой задаче
Block a user