From a59e9bfe45deeaa97711816c07b1a4c29c9c012a Mon Sep 17 00:00:00 2001 From: Sam Sneddon Date: Tue, 17 Sep 2024 16:11:22 -0700 Subject: [PATCH] Make GitHub wpt org admins have admin access to wpt.fyi --- shared/github_oauth.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared/github_oauth.go b/shared/github_oauth.go index ed1a988f7f..2bfcf1bb40 100644 --- a/shared/github_oauth.go +++ b/shared/github_oauth.go @@ -163,6 +163,10 @@ func (gaci githubAccessControlImpl) IsValidAdmin() (bool, error) { if !valid { return false, errors.New("Invalid access token") } + membership, _, err := gaci.oauthGHClient.Organizations.GetOrgMembership(gaci.ctx, "", "web-platform-tests") + if err == nil && *membership.Role == "admin" { + return true, nil + } key := gaci.ds.NewNameKey("Admin", gaci.user.GitHubHandle) var dst struct{} if err := gaci.ds.Get(key, &dst); err == ErrNoSuchEntity {