From ef1cbcd761939e7730089fce9f5fbfdabe82c5bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Justin=20Nu=C3=9F?= <justin.nuss@hmmh.de>
Date: Thu, 24 Jul 2014 12:39:03 +0200
Subject: [PATCH] Allow admins to delete attachments.

---
 routers/repo/issue.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index c9d3112ea..6becb2dff 100644
--- a/routers/repo/issue.go
+++ b/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",