Sfoglia il codice sorgente

Allow admins to delete attachments.

Justin Nuß 10 anni fa
parent
commit
ef1cbcd761
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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
 	}
 
-	if comment.PosterId != ctx.User.Id {
+	if comment.PosterId != ctx.User.Id && !ctx.User.IsAdmin {
 		ctx.JSON(400, map[string]interface{}{
 			"ok":    false,
 			"error": "no permissions",