коммит произвёл
GitHub
родитель
532f2882d1
Коммит
450dba8cad
@@ -1020,6 +1020,12 @@ func updatePost(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
// Users who can't create posts in a channel shouldn't be able to edit them either.
|
||||
userCreatePostPermissionCheckWithContext(c, originalPost.ChannelId)
|
||||
if c.Err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
auditRec.AddEventPriorState(originalPost)
|
||||
auditRec.AddEventObjectType("post")
|
||||
|
||||
@@ -1157,6 +1163,12 @@ func postPatchChecks(c *Context, auditRec *model.AuditRecord, message *string) b
|
||||
return false
|
||||
}
|
||||
|
||||
// Users who can't create posts in a channel shouldn't be able to edit them either.
|
||||
userCreatePostPermissionCheckWithContext(c, originalPost.ChannelId)
|
||||
if c.Err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
if *c.App.Config().ServiceSettings.PostEditTimeLimit != -1 && model.GetMillis() > originalPost.CreateAt+int64(*c.App.Config().ServiceSettings.PostEditTimeLimit*1000) && message != nil {
|
||||
c.Err = model.NewAppError("patchPost", "api.post.update_post.permissions_time_limit.app_error", map[string]any{"timeLimit": *c.App.Config().ServiceSettings.PostEditTimeLimit}, "", http.StatusBadRequest)
|
||||
return isMember
|
||||
|
||||
Ссылка в новой задаче
Block a user