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