Merge pull request #2965 from cli/writeorg-oauth-scope
Recognize the `write:org` OAuth scope as satisfying `read:org`
This commit is contained in:
commit
faa6981f46
2 changed files with 6 additions and 1 deletions
|
|
@ -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")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue