Skip to content

Commit e6652f4

Browse files
committed
fix: owner or admin only
1 parent 0a1eb84 commit e6652f4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

routers/web/repo/view.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,10 @@ func renderHomeCode(ctx *context.Context) {
10751075
}
10761076

10771077
func checkOutdatedBranch(ctx *context.Context) {
1078+
if !(ctx.Repo.IsAdmin() || ctx.Repo.IsOwner()) {
1079+
return
1080+
}
1081+
10781082
// get the head commit of the branch since ctx.Repo.CommitID is not always the head commit of `ctx.Repo.BranchName`
10791083
commit, err := ctx.Repo.GitRepo.GetBranchCommit(ctx.Repo.BranchName)
10801084
if err != nil {

0 commit comments

Comments
 (0)