]> source.dussan.org Git - gitea.git/commitdiff
Allow admins to delete attachments.
authorJustin Nuß <justin.nuss@hmmh.de>
Thu, 24 Jul 2014 10:39:03 +0000 (12:39 +0200)
committerJustin Nuß <justin.nuss@hmmh.de>
Thu, 24 Jul 2014 10:39:03 +0000 (12:39 +0200)
routers/repo/issue.go

index c9d3112eaa23ad2da4f6b6b0163d20e20515adf7..6becb2dff79e06cfab7cea862e39764fe3a9b02a 100644 (file)
@@ -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",