Skip to content

Commit caa53b2

Browse files
committed
Backport go-gitea#13349
Unfortunately my final push to go-gitea#13344 didn't register - or I failed to push it properly. GetIssueCommentReactions in routers/api/v1/repo/issue_reaction.go also makes the same mistake.
1 parent dc7c67b commit caa53b2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

routers/api/v1/repo/issue_reaction.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ func GetIssueCommentReactions(ctx *context.APIContext) {
5656
return
5757
}
5858

59-
if !ctx.Repo.CanRead(models.UnitTypeIssues) {
59+
if err := comment.LoadIssue(); err != nil {
60+
ctx.Error(http.StatusInternalServerError, "comment.LoadIssue", err)
61+
}
62+
63+
if !ctx.Repo.CanReadIssuesOrPulls(comment.Issue.IsPull) {
6064
ctx.Error(http.StatusForbidden, "GetIssueCommentReactions", errors.New("no permission to get reactions"))
6165
return
6266
}

0 commit comments

Comments
 (0)