summaryrefslogtreecommitdiffstats
path: root/routers/api/v1
diff options
context:
space:
mode:
author赵智超 <1012112796@qq.com>2020-09-21 05:55:48 +0800
committerGitHub <noreply@github.com>2020-09-21 00:55:48 +0300
commitb74ed16c416d58cad29ebc0013a1de6960bc73d3 (patch)
treebb10aa2e944d344d981fb36d6f9eaac85ae9528a /routers/api/v1
parent23f064e81361cbd267df9ce9262bef00eed217a8 (diff)
downloadgitea-b74ed16c416d58cad29ebc0013a1de6960bc73d3.tar.gz
gitea-b74ed16c416d58cad29ebc0013a1de6960bc73d3.zip
Fix ListUserOrgs (#12910)
fix #12891 Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'routers/api/v1')
-rw-r--r--routers/api/v1/org/org.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/org/org.go b/routers/api/v1/org/org.go
index 7577700abf..987f141078 100644
--- a/routers/api/v1/org/org.go
+++ b/routers/api/v1/org/org.go
@@ -85,7 +85,7 @@ func ListUserOrgs(ctx *context.APIContext) {
if ctx.Written() {
return
}
- listUserOrgs(ctx, u, ctx.User.IsAdmin)
+ listUserOrgs(ctx, u, ctx.User != nil && (ctx.User.IsAdmin || ctx.User.ID == u.ID))
}
// GetAll return list of all public organizations