mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-21 01:10:19 +00:00
#1692 add admin APIs to add/remove a user from teams
This commit is contained in:
parent
9dda9ef07c
commit
b1d41cfa60
11 changed files with 712 additions and 639 deletions
|
@ -42,20 +42,12 @@ func ListUserOrgs(ctx *context.APIContext) {
|
|||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Organizations#get-an-organization
|
||||
func Get(ctx *context.APIContext) {
|
||||
org := user.GetUserByParamsName(ctx, ":orgname")
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
ctx.JSON(200, convert.ToOrganization(org))
|
||||
ctx.JSON(200, convert.ToOrganization(ctx.Org.Organization))
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Organizations#edit-an-organization
|
||||
func Edit(ctx *context.APIContext, form api.EditOrgOption) {
|
||||
org := user.GetUserByParamsName(ctx, ":orgname")
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
|
||||
org := ctx.Org.Organization
|
||||
if !org.IsOwnedBy(ctx.User.Id) {
|
||||
ctx.Status(403)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue