diff --git a/routers/api/v1/org/org.go b/routers/api/v1/org/org.go index 7577700ab..987f14107 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