瀏覽代碼

Allow admins to delete attachments.

Justin Nuß 10 年之前
父節點
當前提交
ef1cbcd761
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      routers/repo/issue.go

+ 1 - 1
routers/repo/issue.go

@@ -1158,7 +1158,7 @@ func IssueDeleteAttachment(ctx *middleware.Context, params martini.Params) {
 		return
 		return
 	}
 	}
 
 
-	if comment.PosterId != ctx.User.Id {
+	if comment.PosterId != ctx.User.Id && !ctx.User.IsAdmin {
 		ctx.JSON(400, map[string]interface{}{
 		ctx.JSON(400, map[string]interface{}{
 			"ok":    false,
 			"ok":    false,
 			"error": "no permissions",
 			"error": "no permissions",