Browse Source

fix adding reaction fail for read permission (#5515)

tags/v1.7.0-dev
Lunny Xiao 5 years ago
parent
commit
ccea91652f
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      routers/repo/issue.go

+ 2
- 2
routers/repo/issue.go View File

return 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) ctx.Error(403)
return return
} }
return 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) ctx.Error(403)
return return
} else if comment.Type != models.CommentTypeComment && comment.Type != models.CommentTypeCode { } else if comment.Type != models.CommentTypeComment && comment.Type != models.CommentTypeCode {

Loading…
Cancel
Save