diff options
author | zeripath <art27@cantab.net> | 2020-10-29 12:48:58 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-29 20:48:58 +0800 |
commit | f825e2a56866eb0149f2c2ba5ba8031614103aa8 (patch) | |
tree | 5e8e7484bcfcdc0ce98544a95d33a937488c362f /routers | |
parent | 8e38bd154f9d39c6e3b6b991649ae0e1152a4fc3 (diff) | |
download | gitea-f825e2a56866eb0149f2c2ba5ba8031614103aa8.tar.gz gitea-f825e2a56866eb0149f2c2ba5ba8031614103aa8.zip |
And there is another one ... (#13350)
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/repo/issue_reaction.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/api/v1/repo/issue_reaction.go b/routers/api/v1/repo/issue_reaction.go index 4ac6439d1b..596c490827 100644 --- a/routers/api/v1/repo/issue_reaction.go +++ b/routers/api/v1/repo/issue_reaction.go @@ -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 } |