Automatic Merge
Этот коммит содержится в:
Harshil Sharma
2026-05-25 15:54:05 +05:30
коммит произвёл GitHub
родитель c0ea57ac6c
Коммит 36ac3a43b1
28 изменённых файлов: 602 добавлений и 31 удалений

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

@@ -1065,6 +1065,12 @@ func updatePost(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
// Check edit_file_attachment permission if file IDs are being changed (files added or removed)
checkEditFileAttachmentPermission(c, post.FileIds, originalPost)
if c.Err != nil {
return
}
if c.AppContext.Session().UserId != originalPost.UserId {
// We don't need to check the member here, since we already checked it above
if ok, _ := c.App.SessionHasPermissionToChannel(c.AppContext, *c.AppContext.Session(), originalPost.ChannelId, model.PermissionEditOthersPosts); !ok {
@@ -1139,6 +1145,11 @@ func patchPost(c *Context, w http.ResponseWriter, r *http.Request) {
if c.Err != nil {
return
}
checkEditFileAttachmentPermission(c, *post.FileIds, originalPost)
if c.Err != nil {
return
}
}
patchedPost, isMemberForPReviews, err := c.App.PatchPost(c.AppContext, c.Params.PostId, c.App.PostPatchWithProxyRemovedFromImageURLs(&post), nil)