Skip to content

Commit feb38da

Browse files
authored
1 parent 96f9c11 commit feb38da

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

routers/web/web.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,12 @@ func registerRoutes(m *web.Route) {
356356
m.Get("/users", explore.Users)
357357
m.Get("/users/sitemap-{idx}.xml", sitemapEnabled, explore.Users)
358358
m.Get("/organizations", explore.Organizations)
359-
m.Get("/code", reqUnitAccess(unit.TypeCode, perm.AccessModeRead), explore.Code)
359+
m.Get("/code", func(ctx *context.Context) {
360+
if unit.TypeCode.UnitGlobalDisabled() {
361+
ctx.NotFound(unit.TypeCode.String(), nil)
362+
return
363+
}
364+
}, explore.Code)
360365
m.Get("/topics/search", explore.TopicSearch)
361366
}, ignExploreSignIn)
362367
m.Group("/issues", func() {

0 commit comments

Comments
 (0)