0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-17 07:21:15 +01:00

[API] let admin check org membership on other users (#10201)

* fix

* fix lint on master

Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
6543 2020-02-09 22:54:53 +01:00 committed by GitHub
parent e414fc18a9
commit 585316f3bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -135,7 +135,7 @@ func IsMember(ctx *context.APIContext) {
if err != nil { if err != nil {
ctx.Error(http.StatusInternalServerError, "IsOrgMember", err) ctx.Error(http.StatusInternalServerError, "IsOrgMember", err)
return return
} else if userIsMember { } else if userIsMember || ctx.User.IsAdmin {
userToCheckIsMember, err := ctx.Org.Organization.IsOrgMember(userToCheck.ID) userToCheckIsMember, err := ctx.Org.Organization.IsOrgMember(userToCheck.ID)
if err != nil { if err != nil {
ctx.Error(http.StatusInternalServerError, "IsOrgMember", err) ctx.Error(http.StatusInternalServerError, "IsOrgMember", err)