Skip to content

Commit faa6981

Browse files
authored
Merge pull request cli#2965 from cli/writeorg-oauth-scope
Recognize the `write:org` OAuth scope as satisfying `read:org`
2 parents 3a224b7 + 4a49e35 commit faa6981

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎pkg/cmd/auth/shared/oauth_scopes.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func HasMinimumScopes(httpClient httpClient, hostname, authToken string) error {
7979
missingScopes = append(missingScopes, "repo")
8080
}
8181

82-
if !search["read:org"] && !search["admin:org"] {
82+
if !search["read:org"] && !search["write:org"] && !search["admin:org"] {
8383
missingScopes = append(missingScopes, "read:org")
8484
}
8585

‎pkg/cmd/auth/shared/oauth_scopes_test.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ func Test_HasMinimumScopes(t *testing.T) {
3131
header: "repo, admin:org",
3232
wantErr: "",
3333
},
34+
{
35+
name: "write:org satisfies read:org",
36+
header: "repo, write:org",
37+
wantErr: "",
38+
},
3439
{
3540
name: "insufficient scope",
3641
header: "repo",

0 commit comments

Comments
 (0)