hunk.code_window: 		return
   	}
   	if _, err := c.App.DeletePost(c.Params.PostId); err != nil {
   		c.Err = err
   		return
   	}
  
hunk.labels: keep keep add keep keep keep keep
hunk.after_edit: 	if c.Session.UserId == post.UserId {
   		if !c.App.SessionHasPermissionToChannel(c.Session, post.ChannelId, model.PERMISSION_DELETE_POST) {
   			c.SetPermissionError(model.PERMISSION_DELETE_POST)
   			return
   		}
   	} else {
   		if !c.App.SessionHasPermissionToChannel(c.Session, post.ChannelId, model.PERMISSION_DELETE_OTHERS_POSTS) {
   			c.SetPermissionError(model.PERMISSION_DELETE_OTHERS_POSTS)
   			return
   		}
   	}
  
hunk.file_path: api4/post.go
hunk.type: add
file: // Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
  // See License.txt for license information.
  
  package utils
  
  import (
  	"path/filepath"
  	"strings"
  )
  
  // PathTraversesUpward will return true if the path attempts to traverse upwards by using
  // ".." in the path.
  func PathTraversesUpward(path string) bool {
  	return strings.HasPrefix(filepath.Clean(path), "..")
  }
  