Skip to content

Commit

Permalink
Backport go-gitea#13349
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zeripath committed Oct 29, 2020
1 parent dc7c67b commit caa53b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion routers/api/v1/repo/issue_reaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ func GetIssueCommentReactions(ctx *context.APIContext) {
return
}

if !ctx.Repo.CanRead(models.UnitTypeIssues) {
if err := comment.LoadIssue(); err != nil {
ctx.Error(http.StatusInternalServerError, "comment.LoadIssue", err)
}

if !ctx.Repo.CanReadIssuesOrPulls(comment.Issue.IsPull) {
ctx.Error(http.StatusForbidden, "GetIssueCommentReactions", errors.New("no permission to get reactions"))
return
}
Expand Down

0 comments on commit caa53b2

Please sign in to comment.