Skip to content

Commit 8216008

Browse files
committed
fix(PR): Add permission check
1 parent 1b9ac2c commit 8216008

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

routers/web/repo/compare.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,10 @@ func ExcerptBlob(ctx *context.Context) {
956956
ctx.Data["PageIsPullFiles"] = isPull
957957

958958
if isPull {
959+
if !ctx.Repo.CanRead(unit.TypePullRequests) {
960+
ctx.NotFound(nil)
961+
return
962+
}
959963
issueIndex := ctx.FormInt64("issue_index")
960964
ctx.Data["IssueIndex"] = issueIndex
961965
if issueIndex > 0 {

0 commit comments

Comments
 (0)