Skip to content

Commit ccea916

Browse files
lunnytechknowlogick
authored andcommitted
fix adding reaction fail for read permission (#5515)
1 parent 6e114f6 commit ccea916

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

routers/repo/issue.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,7 @@ func ChangeIssueReaction(ctx *context.Context, form auth.ReactionForm) {
12481248
return
12491249
}
12501250

1251-
if !ctx.IsSigned || (ctx.User.ID != issue.PosterID && !ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull)) {
1251+
if !ctx.IsSigned || (ctx.User.ID != issue.PosterID && !ctx.Repo.CanReadIssuesOrPulls(issue.IsPull)) {
12521252
ctx.Error(403)
12531253
return
12541254
}
@@ -1327,7 +1327,7 @@ func ChangeCommentReaction(ctx *context.Context, form auth.ReactionForm) {
13271327
return
13281328
}
13291329

1330-
if !ctx.IsSigned || (ctx.User.ID != comment.PosterID && !ctx.Repo.CanWriteIssuesOrPulls(comment.Issue.IsPull)) {
1330+
if !ctx.IsSigned || (ctx.User.ID != comment.PosterID && !ctx.Repo.CanReadIssuesOrPulls(comment.Issue.IsPull)) {
13311331
ctx.Error(403)
13321332
return
13331333
} else if comment.Type != models.CommentTypeComment && comment.Type != models.CommentTypeCode {

0 commit comments

Comments
 (0)