Browse Source

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

* fix

* fix lint on master

Co-authored-by: zeripath <art27@cantab.net>
for-closed-social
6543 4 years ago
committed by GitHub
parent
commit
585316f3bf
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      routers/api/v1/org/member.go

+ 1
- 1
routers/api/v1/org/member.go 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)

Loading…
Cancel
Save