From 9e248b50c3cb25518c19a91cf4361d52908f435b Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 14 Oct 2024 19:24:23 +0800 Subject: [PATCH] fix --- routers/web/web.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routers/web/web.go b/routers/web/web.go index 80399ec499c50..2239b22e2547c 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -1524,7 +1524,10 @@ func registerRoutes(m *web.Router) { }, context.RepoMustNotBeArchived()) }) }, repo.MustAllowPulls) + }, ignSignIn, context.RepoAssignment, context.RequireRepoReaderOr(unit.TypeCode, unit.TypePullRequests)) + // end "/{username}/{reponame}": pull request view/edit + m.Group("/pulls/{index}", func() { m.Group("/media", func() { m.Get("/branch/*", context.RepoRefByType(context.RepoRefBranch), repo.SingleDownloadOrLFS) m.Get("/tag/*", context.RepoRefByType(context.RepoRefTag), repo.SingleDownloadOrLFS) @@ -1585,7 +1588,7 @@ func registerRoutes(m *web.Router) { m.Get("/commit/{sha:([a-f0-9]{7,64})}.{ext:patch|diff}", repo.MustBeNotEmpty, repo.RawDiff) m.Post("/lastcommit/*", context.RepoRefByType(context.RepoRefCommit), repo.LastCommit) }, ignSignIn, context.RepoAssignment, reqRepoCodeReader) - // end "/{username}/{reponame}": repo code + // end "/{username}/{reponame}": pull request code m.Group("/{username}/{reponame}", func() { m.Get("/stars", repo.Stars)