diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2018-12-12 02:12:06 +0800 |
---|---|---|
committer | techknowlogick <hello@techknowlogick.com> | 2018-12-11 13:12:06 -0500 |
commit | ccea91652f8d23bd65494f5c04275506118aaa27 (patch) | |
tree | d53602a06479dae41a81f39cf235823f19de3a7c | |
parent | 6e114f6791374d56c46978009ade7da22e34001a (diff) | |
download | gitea-ccea91652f8d23bd65494f5c04275506118aaa27.tar.gz gitea-ccea91652f8d23bd65494f5c04275506118aaa27.zip |
fix adding reaction fail for read permission (#5515)
-rw-r--r-- | routers/repo/issue.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index dd1c5cfa56..c04cc27746 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -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 } @@ -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 { |