Browse Source
Allow site admin to check /api/v1/orgs endpoints (#10867)
Fix #9950
Signed-off-by: Andrew Thornton <art27@cantab.net>
tags/v1.21.12.1
zeripath
GitHub
6 years ago
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
2 additions and
2 deletions
-
routers/api/v1/org/member.go
-
routers/api/v1/org/team.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) |
|
|
|
} |
|
|
|
|
|
|
|
@@ -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 |
|
|
|
} |
|
|
|
|