Skip to content

Commit 55801cf

Browse files
authored
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 <[email protected]> * When checking issue reactions check the correct permission Signed-off-by: Andrew Thornton <[email protected]> * And there is another one ... Signed-off-by: Andrew Thornton <[email protected]>
1 parent 4b33afc commit 55801cf

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
@@ -57,7 +57,11 @@ func GetIssueCommentReactions(ctx *context.APIContext) {
5757
return
5858
}
5959

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

0 commit comments

Comments
 (0)