mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 12:47:53 +01:00
Allow site admin to check /api/v1/orgs endpoints (#10867)
Fix #9950 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
052bff0cff
commit
48890ce546
@ -69,7 +69,7 @@ func ListMembers(ctx *context.APIContext) {
|
|||||||
ctx.Error(http.StatusInternalServerError, "IsOrgMember", err)
|
ctx.Error(http.StatusInternalServerError, "IsOrgMember", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
publicOnly = !isMember
|
publicOnly = !isMember && !ctx.User.IsAdmin
|
||||||
}
|
}
|
||||||
listMembers(ctx, publicOnly)
|
listMembers(ctx, publicOnly)
|
||||||
}
|
}
|
||||||
|
@ -320,7 +320,7 @@ func GetTeamMembers(ctx *context.APIContext) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.Error(http.StatusInternalServerError, "IsOrganizationMember", err)
|
ctx.Error(http.StatusInternalServerError, "IsOrganizationMember", err)
|
||||||
return
|
return
|
||||||
} else if !isMember {
|
} else if !isMember && !ctx.User.IsAdmin {
|
||||||
ctx.NotFound()
|
ctx.NotFound()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user