mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-20 05:11:32 +00:00
Add org list (#2338)
 Closes #2307
This commit is contained in:
@@ -46,20 +46,25 @@ func apiRoutes(e *gin.RouterGroup) {
|
||||
users.DELETE("/:login", api.DeleteUser)
|
||||
}
|
||||
|
||||
apiBase.GET("/orgs/lookup/*org_full_name", api.LookupOrg)
|
||||
orgBase := apiBase.Group("/orgs/:org_id")
|
||||
orgs := apiBase.Group("/orgs")
|
||||
{
|
||||
orgBase.GET("/permissions", api.GetOrgPermissions)
|
||||
|
||||
org := orgBase.Group("")
|
||||
orgs.GET("", session.MustAdmin(), api.GetOrgs)
|
||||
orgs.GET("/lookup/*org_full_name", api.LookupOrg)
|
||||
orgBase := orgs.Group("/:org_id")
|
||||
{
|
||||
org.Use(session.MustOrgMember(true))
|
||||
org.GET("", api.GetOrg)
|
||||
org.GET("/secrets", api.GetOrgSecretList)
|
||||
org.POST("/secrets", api.PostOrgSecret)
|
||||
org.GET("/secrets/:secret", api.GetOrgSecret)
|
||||
org.PATCH("/secrets/:secret", api.PatchOrgSecret)
|
||||
org.DELETE("/secrets/:secret", api.DeleteOrgSecret)
|
||||
orgBase.GET("/permissions", api.GetOrgPermissions)
|
||||
|
||||
org := orgBase.Group("")
|
||||
{
|
||||
org.Use(session.MustOrgMember(true))
|
||||
org.DELETE("", session.MustAdmin(), api.DeleteOrg)
|
||||
org.GET("", api.GetOrg)
|
||||
org.GET("/secrets", api.GetOrgSecretList)
|
||||
org.POST("/secrets", api.PostOrgSecret)
|
||||
org.GET("/secrets/:secret", api.GetOrgSecret)
|
||||
org.PATCH("/secrets/:secret", api.PatchOrgSecret)
|
||||
org.DELETE("/secrets/:secret", api.DeleteOrgSecret)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user