summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/issue_reaction.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-10-29 12:48:07 +0000
committerGitHub <noreply@github.com>2020-10-29 20:48:07 +0800
commit55801cf4eb9daeae43c828e54cd94ad841578cb6 (patch)
tree32e3e6c8788e65d979449d285432f75da765b44e /routers/api/v1/repo/issue_reaction.go
parent4b33afcd5bf08afa116512eaea92c73ade332bee (diff)
downloadgitea-55801cf4eb9daeae43c828e54cd94ad841578cb6.tar.gz
gitea-55801cf4eb9daeae43c828e54cd94ad841578cb6.zip
Issue comment reactions should also check pull type (#13349)
* Migrating reactions is just not that important A failure during migrating reactions should not cause failure of migration. Signed-off-by: Andrew Thornton <art27@cantab.net> * When checking issue reactions check the correct permission Signed-off-by: Andrew Thornton <art27@cantab.net> * And there is another one ... Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers/api/v1/repo/issue_reaction.go')
-rw-r--r--routers/api/v1/repo/issue_reaction.go6
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 5c983b0fc5..dfe618480f 100644
--- a/routers/api/v1/repo/issue_reaction.go
+++ b/routers/api/v1/repo/issue_reaction.go
@@ -57,7 +57,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
}