Skip to content

Commit 252d0e2

Browse files
committed
Allow site admin to check /api/v1/orgs endpoints
Fix go-gitea#9950 Signed-off-by: Andrew Thornton <[email protected]>
1 parent ea67e56 commit 252d0e2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

routers/api/v1/org/member.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func ListMembers(ctx *context.APIContext) {
6969
ctx.Error(http.StatusInternalServerError, "IsOrgMember", err)
7070
return
7171
}
72-
publicOnly = !isMember
72+
publicOnly = !isMember && !ctx.User.IsAdmin
7373
}
7474
listMembers(ctx, publicOnly)
7575
}

routers/api/v1/org/team.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ func GetTeamMembers(ctx *context.APIContext) {
320320
if err != nil {
321321
ctx.Error(http.StatusInternalServerError, "IsOrganizationMember", err)
322322
return
323-
} else if !isMember {
323+
} else if !isMember && !ctx.User.IsAdmin {
324324
ctx.NotFound()
325325
return
326326
}

0 commit comments

Comments
 (0)