diff --git a/routers/api/v1/org/org.go b/routers/api/v1/org/org.go index b79761c875..9c671c8d1a 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