From 48890ce5468f804a72e210e57e5b3800c9d34ffd Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 28 Mar 2020 19:45:55 +0000 Subject: [PATCH] Allow site admin to check /api/v1/orgs endpoints (#10867) Fix #9950 Signed-off-by: Andrew Thornton --- routers/api/v1/org/member.go | 2 +- routers/api/v1/org/team.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/routers/api/v1/org/member.go b/routers/api/v1/org/member.go index 267eda12a..e452683da 100644 --- a/routers/api/v1/org/member.go +++ b/routers/api/v1/org/member.go @@ -69,7 +69,7 @@ func ListMembers(ctx *context.APIContext) { ctx.Error(http.StatusInternalServerError, "IsOrgMember", err) return } - publicOnly = !isMember + publicOnly = !isMember && !ctx.User.IsAdmin } listMembers(ctx, publicOnly) } diff --git a/routers/api/v1/org/team.go b/routers/api/v1/org/team.go index 1bf984b17..7b44a4787 100644 --- a/routers/api/v1/org/team.go +++ b/routers/api/v1/org/team.go @@ -320,7 +320,7 @@ func GetTeamMembers(ctx *context.APIContext) { if err != nil { ctx.Error(http.StatusInternalServerError, "IsOrganizationMember", err) return - } else if !isMember { + } else if !isMember && !ctx.User.IsAdmin { ctx.NotFound() return }