From b451bb71aec87bdcebf04367dcfe729051523a92 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 11 Dec 2018 10:29:26 +0800 Subject: [PATCH] fix adding reaction fail for read permission --- routers/repo/issue.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 34a01617e4da4..067975a7a162c 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -1240,7 +1240,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 } @@ -1319,7 +1319,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 {