Skip to content

Commit

Permalink
fix adding reaction fail for read permission (#5515)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored and techknowlogick committed Dec 11, 2018
1 parent 6e114f6 commit ccea916
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routers/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ func ChangeIssueReaction(ctx *context.Context, form auth.ReactionForm) {
return
}

if !ctx.IsSigned || (ctx.User.ID != issue.PosterID && !ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull)) {
if !ctx.IsSigned || (ctx.User.ID != issue.PosterID && !ctx.Repo.CanReadIssuesOrPulls(issue.IsPull)) {
ctx.Error(403)
return
}
Expand Down Expand Up @@ -1327,7 +1327,7 @@ func ChangeCommentReaction(ctx *context.Context, form auth.ReactionForm) {
return
}

if !ctx.IsSigned || (ctx.User.ID != comment.PosterID && !ctx.Repo.CanWriteIssuesOrPulls(comment.Issue.IsPull)) {
if !ctx.IsSigned || (ctx.User.ID != comment.PosterID && !ctx.Repo.CanReadIssuesOrPulls(comment.Issue.IsPull)) {
ctx.Error(403)
return
} else if comment.Type != models.CommentTypeComment && comment.Type != models.CommentTypeCode {
Expand Down

0 comments on commit ccea916

Please sign in to comment.