[MM-42194] Get file information from a deleted post (#20279)
* Introduced inlcude_deleted query parameter to allow admins to retrieve contents of post regardless of deletion status * Introduced new client route and tests for getting file info of deleted posts * Fixed tests due to caching of posts * gofmt * Small formatting updates * Invalidating file infos cache on delete of post if post includes files * Including deleted in migration flow * Moved invalidating of cache Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
bc7f961d75
Коммит
3d7859396d
@@ -898,7 +898,13 @@ func getFileInfosForPost(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
infos, err := c.App.GetFileInfosForPostWithMigration(c.Params.PostId)
|
||||
includeDeleted, _ := strconv.ParseBool(r.URL.Query().Get("include_deleted"))
|
||||
if includeDeleted && !c.App.SessionHasPermissionTo(*c.AppContext.Session(), model.PermissionManageSystem) {
|
||||
c.SetPermissionError(model.PermissionManageSystem)
|
||||
return
|
||||
}
|
||||
|
||||
infos, err := c.App.GetFileInfosForPostWithMigration(c.Params.PostId, includeDeleted)
|
||||
if err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
|
||||
Ссылка в новой задаче
Block a user