From fc3825f6b2ec50d9e5be67a9945d4264242ebfe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Sun, 26 Nov 2023 06:33:42 +0100 Subject: [PATCH] Revert "fix DELETE /api/v1/repos/{owner}/{repo}/issues/comments/{id}" This reverts commit 0b0b506b74d245a60a824cc002f940738af2cf0f. --- routers/api/v1/repo/issue_comment.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/routers/api/v1/repo/issue_comment.go b/routers/api/v1/repo/issue_comment.go index f96ebb9611..30a2fb25ed 100644 --- a/routers/api/v1/repo/issue_comment.go +++ b/routers/api/v1/repo/issue_comment.go @@ -693,17 +693,7 @@ func deleteIssueComment(ctx *context.APIContext) { return } - if err := comment.LoadIssue(ctx); err != nil { - ctx.Error(http.StatusInternalServerError, "LoadIssue", err) - return - } - - if comment.Issue.RepoID != ctx.Repo.Repository.ID { - ctx.Status(http.StatusNotFound) - return - } - - if !ctx.IsSigned || (ctx.Doer.ID != comment.PosterID && !ctx.Repo.CanWriteIssuesOrPulls(comment.Issue.IsPull)) { + if !ctx.IsSigned || (ctx.Doer.ID != comment.PosterID && !ctx.Repo.IsAdmin()) { ctx.Status(http.StatusForbidden) return } else if comment.Type != issues_model.CommentTypeComment {