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