diff --git a/pkg/cmd/auth/shared/oauth_scopes.go b/pkg/cmd/auth/shared/oauth_scopes.go index b60ddae66..c99b5543d 100644 --- a/pkg/cmd/auth/shared/oauth_scopes.go +++ b/pkg/cmd/auth/shared/oauth_scopes.go @@ -79,7 +79,7 @@ func HasMinimumScopes(httpClient httpClient, hostname, authToken string) error { missingScopes = append(missingScopes, "repo") } - if !search["read:org"] && !search["admin:org"] { + if !search["read:org"] && !search["write:org"] && !search["admin:org"] { missingScopes = append(missingScopes, "read:org") } diff --git a/pkg/cmd/auth/shared/oauth_scopes_test.go b/pkg/cmd/auth/shared/oauth_scopes_test.go index e92020f08..3b9766a95 100644 --- a/pkg/cmd/auth/shared/oauth_scopes_test.go +++ b/pkg/cmd/auth/shared/oauth_scopes_test.go @@ -31,6 +31,11 @@ func Test_HasMinimumScopes(t *testing.T) { header: "repo, admin:org", wantErr: "", }, + { + name: "write:org satisfies read:org", + header: "repo, write:org", + wantErr: "", + }, { name: "insufficient scope", header: "repo",