add tests for api user orgs (#5494)

* add tests for api user orgs

* add permission for admin to list user's orgs even he is a private user of org
This commit is contained in:
Lunny Xiao 2018-12-09 10:19:50 +08:00 committed by GitHub
parent 4b4453cb92
commit da5a0b8382
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 64 additions and 1 deletions

View file

@ -60,7 +60,7 @@ func ListUserOrgs(ctx *context.APIContext) {
if ctx.Written() {
return
}
listUserOrgs(ctx, u, false)
listUserOrgs(ctx, u, ctx.User.IsAdmin)
}
// Create api for create organization