From 4ece6a4b1985ff773d98ace19018b82445f86149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Sun, 26 Nov 2023 06:33:48 +0100 Subject: [PATCH] Revert "fix PATCH /api/v1/repos/{owner}/{repo}/issues/comments/{id}" This reverts commit e291ea5e3310e991709426b07261e4586e744c36. --- 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 30a2fb25ed..7f9eff04ec 100644 --- a/routers/api/v1/repo/issue_comment.go +++ b/routers/api/v1/repo/issue_comment.go @@ -580,17 +580,7 @@ func editIssueComment(ctx *context.APIContext, form api.EditIssueCommentOption) 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 }