Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-22 01:44:24 +01:00

Fix search team (#31923)

Fix #20658

(cherry picked from commit 06c67c6d5a91176fe4b87fc884c96afc7c3597fa)
This commit is contained in:
Lunny Xiao 2024-08-29 21:26:25 +08:00 committed by Earl Warren
parent 1751825256
commit 4ee3a150a3
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -855,10 +855,15 @@ func registerRoutes(m *web.Route) {
m.Post("/teams/{team}/action/repo/{action}", org.TeamsRepoAction)
}, context.OrgAssignment(true, false, true))
// require admin permission
m.Group("/{org}", func() {
m.Get("/teams/-/search", org.SearchTeam)
}, context.OrgAssignment(true, false, false, true))
// require owner permission
m.Group("/{org}", func() {
m.Get("/teams/new", org.NewTeam)
m.Post("/teams/new", web.Bind(forms.CreateTeamForm{}), org.NewTeamPost)
m.Get("/teams/-/search", org.SearchTeam)
m.Get("/teams/{team}/edit", org.EditTeam)
m.Post("/teams/{team}/edit", web.Bind(forms.CreateTeamForm{}), org.EditTeamPost)
m.Post("/teams/{team}/delete", org.DeleteTeam)