From b74ed16c416d58cad29ebc0013a1de6960bc73d3 Mon Sep 17 00:00:00 2001 From: 赵智超 <1012112796@qq.com> Date: Mon, 21 Sep 2020 05:55:48 +0800 Subject: Fix ListUserOrgs (#12910) fix #12891 Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lauris BH --- routers/api/v1/org/org.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'routers/api/v1') 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 -- cgit v1.2.3