|
|
|
@ -1200,12 +1200,12 @@ func Routes(ctx gocontext.Context) *web.Route {
|
|
|
|
m.Get("/{org}/permissions", reqToken(auth_model.AccessTokenScopeReadOrg), org.GetUserOrgsPermissions)
|
|
|
|
m.Get("/{org}/permissions", reqToken(auth_model.AccessTokenScopeReadOrg), org.GetUserOrgsPermissions)
|
|
|
|
}, context_service.UserAssignmentAPI())
|
|
|
|
}, context_service.UserAssignmentAPI())
|
|
|
|
m.Post("/orgs", reqToken(auth_model.AccessTokenScopeWriteOrg), bind(api.CreateOrgOption{}), org.Create)
|
|
|
|
m.Post("/orgs", reqToken(auth_model.AccessTokenScopeWriteOrg), bind(api.CreateOrgOption{}), org.Create)
|
|
|
|
m.Get("/orgs", reqToken(auth_model.AccessTokenScopeReadOrg), org.GetAll)
|
|
|
|
m.Get("/orgs", org.GetAll)
|
|
|
|
m.Group("/orgs/{org}", func() {
|
|
|
|
m.Group("/orgs/{org}", func() {
|
|
|
|
m.Combo("").Get(reqToken(auth_model.AccessTokenScopeReadOrg), org.Get).
|
|
|
|
m.Combo("").Get(org.Get).
|
|
|
|
Patch(reqToken(auth_model.AccessTokenScopeWriteOrg), reqOrgOwnership(), bind(api.EditOrgOption{}), org.Edit).
|
|
|
|
Patch(reqToken(auth_model.AccessTokenScopeWriteOrg), reqOrgOwnership(), bind(api.EditOrgOption{}), org.Edit).
|
|
|
|
Delete(reqToken(auth_model.AccessTokenScopeWriteOrg), reqOrgOwnership(), org.Delete)
|
|
|
|
Delete(reqToken(auth_model.AccessTokenScopeWriteOrg), reqOrgOwnership(), org.Delete)
|
|
|
|
m.Combo("/repos").Get(reqToken(auth_model.AccessTokenScopeReadOrg), user.ListOrgRepos).
|
|
|
|
m.Combo("/repos").Get(user.ListOrgRepos).
|
|
|
|
Post(reqToken(auth_model.AccessTokenScopeWriteOrg), bind(api.CreateRepoOption{}), repo.CreateOrgRepo)
|
|
|
|
Post(reqToken(auth_model.AccessTokenScopeWriteOrg), bind(api.CreateRepoOption{}), repo.CreateOrgRepo)
|
|
|
|
m.Group("/members", func() {
|
|
|
|
m.Group("/members", func() {
|
|
|
|
m.Get("", reqToken(auth_model.AccessTokenScopeReadOrg), org.ListMembers)
|
|
|
|
m.Get("", reqToken(auth_model.AccessTokenScopeReadOrg), org.ListMembers)
|
|
|
|
@ -1213,8 +1213,8 @@ func Routes(ctx gocontext.Context) *web.Route {
|
|
|
|
Delete(reqToken(auth_model.AccessTokenScopeWriteOrg), reqOrgOwnership(), org.DeleteMember)
|
|
|
|
Delete(reqToken(auth_model.AccessTokenScopeWriteOrg), reqOrgOwnership(), org.DeleteMember)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
m.Group("/public_members", func() {
|
|
|
|
m.Group("/public_members", func() {
|
|
|
|
m.Get("", reqToken(auth_model.AccessTokenScopeReadOrg), org.ListPublicMembers)
|
|
|
|
m.Get("", org.ListPublicMembers)
|
|
|
|
m.Combo("/{username}").Get(reqToken(auth_model.AccessTokenScopeReadOrg), org.IsPublicMember).
|
|
|
|
m.Combo("/{username}").Get(org.IsPublicMember).
|
|
|
|
Put(reqToken(auth_model.AccessTokenScopeWriteOrg), reqOrgMembership(), org.PublicizeMember).
|
|
|
|
Put(reqToken(auth_model.AccessTokenScopeWriteOrg), reqOrgMembership(), org.PublicizeMember).
|
|
|
|
Delete(reqToken(auth_model.AccessTokenScopeWriteOrg), reqOrgMembership(), org.ConcealMember)
|
|
|
|
Delete(reqToken(auth_model.AccessTokenScopeWriteOrg), reqOrgMembership(), org.ConcealMember)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
@ -1224,7 +1224,7 @@ func Routes(ctx gocontext.Context) *web.Route {
|
|
|
|
m.Get("/search", reqToken(auth_model.AccessTokenScopeReadOrg), org.SearchTeam)
|
|
|
|
m.Get("/search", reqToken(auth_model.AccessTokenScopeReadOrg), org.SearchTeam)
|
|
|
|
}, reqOrgMembership())
|
|
|
|
}, reqOrgMembership())
|
|
|
|
m.Group("/labels", func() {
|
|
|
|
m.Group("/labels", func() {
|
|
|
|
m.Get("", reqToken(auth_model.AccessTokenScopeReadOrg), org.ListLabels)
|
|
|
|
m.Get("", org.ListLabels)
|
|
|
|
m.Post("", reqToken(auth_model.AccessTokenScopeWriteOrg), reqOrgOwnership(), bind(api.CreateLabelOption{}), org.CreateLabel)
|
|
|
|
m.Post("", reqToken(auth_model.AccessTokenScopeWriteOrg), reqOrgOwnership(), bind(api.CreateLabelOption{}), org.CreateLabel)
|
|
|
|
m.Combo("/{id}").Get(reqToken(auth_model.AccessTokenScopeReadOrg), org.GetLabel).
|
|
|
|
m.Combo("/{id}").Get(reqToken(auth_model.AccessTokenScopeReadOrg), org.GetLabel).
|
|
|
|
Patch(reqToken(auth_model.AccessTokenScopeWriteOrg), reqOrgOwnership(), bind(api.EditLabelOption{}), org.EditLabel).
|
|
|
|
Patch(reqToken(auth_model.AccessTokenScopeWriteOrg), reqOrgOwnership(), bind(api.EditLabelOption{}), org.EditLabel).
|
|
|
|
|