aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author赵智超2020-09-21 13:04:33 +0800
committerGitHub2020-09-21 01:04:33 -0400
commit470b195da1c7b56374c1818338d344740d05503f (patch)
treeeb2728c624f9452c21fc857774fde40df1a90d61
parent09178300b0569d18aae5f4f24f4f45ee096e8fe8 (diff)
Fix ListUserOrgs (#12910) (#12915)
fix #12891 Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv>
-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 b79761c87..9c671c8d1 100644
--- a/routers/api/v1/org/org.go
+++ b/routers/api/v1/org/org.go
@@ -84,7 +84,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