Pārlūkot izejas kodu

fix adding reaction fail for read permission (#5515)

tags/v1.7.0-dev
Lunny Xiao pirms 5 gadiem
vecāks
revīzija
ccea91652f
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2
    2
      routers/repo/issue.go

+ 2
- 2
routers/repo/issue.go Parādīt failu

@@ -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 {

Notiek ielāde…
Atcelt
Saglabāt