From 6826b7a4949fd1802704421d0a3bf5436a669126 Mon Sep 17 00:00:00 2001 From: John Allers Date: Mon, 23 Nov 2026 21:03:46 +0000 Subject: [PATCH 1/2] Document direct-collaborators-only grant and revoke behavior Describe how repository Grant and Revoke handle inherited access. Grant returns GrantAlreadyExists when the user already has the requested permission through a team, the org base permission, or org ownership. Revoke removes only the direct collaborator or invitation. No code change. Co-authored-by: c1-squire-dev[bot] Co-Authored-By: Claude Sonnet 5.5 --- docs/connector.mdx | 1 + docs/docs-info.md | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/connector.mdx b/docs/connector.mdx index 44b9279a..ee3049f7 100644 --- a/docs/connector.mdx +++ b/docs/connector.mdx @@ -500,6 +500,7 @@ Enabling **Optimize sync for large organizations** (env var: `BATON_DIRECT_COLLA - **Direct collaborators only.** GitHub is asked only for users with direct repository access. Team-based access is reconstructed from team membership, which the connector already syncs separately. - **Skips per-team detail calls.** The `members_count` and `repos_count` profile fields are not synced for team resources. +- **Inherited access in grant and revoke.** Grant and revoke behave the same with or without this option. A repository grant checks the user's effective access first. If the user already has the requested permission, the grant returns "already exists" and no direct collaborator record is created. Effective access includes access through a team, the organization base permission, and organization ownership. With this option on, the sync lists only direct collaborators. A user with only inherited access can show a fulfilled grant in C1 and have no direct collaborator record on GitHub. A repository revoke removes only the direct collaborator or invitation. It does not change team or organization access, so the user can keep access after a revoke. **Enable this option if** your GitHub organization has thousands of repositories or thousands of members and you want faster syncs and fewer API calls. Repository access data in C1 is equivalent — only the way grants are sourced (direct vs. team-expanded) differs. diff --git a/docs/docs-info.md b/docs/docs-info.md index 05b4d086..0750a318 100644 --- a/docs/docs-info.md +++ b/docs/docs-info.md @@ -73,7 +73,7 @@ `--sync-secrets` — sync fine-grained personal access tokens as API keys `--sync-last-activity` — emit the audit-log usage event feed. Hidden from `--help` and from the GUI config here, because it only applies to GitHub Enterprise audit-log access; `baton-github-enterprise` sets it directly instead of going through this CLI layer `--omit-archived-repositories` — skip archived repositories - `--direct-collaborators-only` — reduce API calls on large organizations + `--direct-collaborators-only` — reduce API calls on large organizations. Grant and revoke do not depend on this option. Grant returns `GrantAlreadyExists` when the user already has the requested permission, including through a team, the organization base permission, or organization ownership. No direct collaborator record is created in that case. Revoke removes only the direct collaborator or invitation, so inherited access stays 2. **For each item in the list above:** - **How does a user create or look up that credential or info?** @@ -169,7 +169,7 @@ - **Parent**: Organization - **Entitlements**: `pull`, `triage`, `push`, `maintain`, `admin` (permission), grantable to users and teams, and declared as an exclusion group because a principal holds one level at a time - **Grants**: One grant per collaborator for their permission level, and one per team with repository access. The organization's `default_repository_permission` is expanded into the cumulative levels it implies and emitted against the organization, annotated as expandable through the org's `member` and `admin` entitlements -- **Provisioning**: Grant and Revoke add or remove a collaborator, or a team's repository access +- **Provisioning**: Grant and Revoke add or remove a collaborator, or a team's repository access. Grant skips a user who already has the requested permission through a team, the organization base permission, or organization ownership. Revoke removes only the direct collaborator or invitation - **Note**: `--omit-archived-repositories` skips archived repositories. `--direct-collaborators-only` relies on grant expansion for team access instead of fetching per-team detail ### Organization roles From 065f58a5cc83ac254b1e3867976fce74d5fed742 Mon Sep 17 00:00:00 2001 From: John Allers Date: Mon, 23 Nov 2026 21:17:06 +0000 Subject: [PATCH 2/2] Clarify exact-match rule for repository grant Grant returns already exists only when the effective permission level equals the requested level. Other levels still add a direct collaborator. Co-authored-by: c1-squire-dev[bot] Co-Authored-By: Claude Sonnet 5.5 --- docs/connector.mdx | 2 +- docs/docs-info.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/connector.mdx b/docs/connector.mdx index ee3049f7..626f1f1e 100644 --- a/docs/connector.mdx +++ b/docs/connector.mdx @@ -500,7 +500,7 @@ Enabling **Optimize sync for large organizations** (env var: `BATON_DIRECT_COLLA - **Direct collaborators only.** GitHub is asked only for users with direct repository access. Team-based access is reconstructed from team membership, which the connector already syncs separately. - **Skips per-team detail calls.** The `members_count` and `repos_count` profile fields are not synced for team resources. -- **Inherited access in grant and revoke.** Grant and revoke behave the same with or without this option. A repository grant checks the user's effective access first. If the user already has the requested permission, the grant returns "already exists" and no direct collaborator record is created. Effective access includes access through a team, the organization base permission, and organization ownership. With this option on, the sync lists only direct collaborators. A user with only inherited access can show a fulfilled grant in C1 and have no direct collaborator record on GitHub. A repository revoke removes only the direct collaborator or invitation. It does not change team or organization access, so the user can keep access after a revoke. +- **Inherited access in grant and revoke.** Grant and revoke behave the same with or without this option. A repository grant checks the user's effective access first. If the effective permission level is exactly the requested level, the grant returns "already exists" and no direct collaborator record is created. If the effective level is higher or lower, the grant still adds a direct collaborator. Effective access includes access through a team, the organization base permission, and organization ownership. With this option on, the sync lists only direct collaborators. A user with only inherited access can show a fulfilled grant in C1 and have no direct collaborator record on GitHub. A repository revoke removes only the direct collaborator or invitation. It does not change team or organization access, so the user can keep access after a revoke. **Enable this option if** your GitHub organization has thousands of repositories or thousands of members and you want faster syncs and fewer API calls. Repository access data in C1 is equivalent — only the way grants are sourced (direct vs. team-expanded) differs. diff --git a/docs/docs-info.md b/docs/docs-info.md index 0750a318..23951a0d 100644 --- a/docs/docs-info.md +++ b/docs/docs-info.md @@ -73,7 +73,7 @@ `--sync-secrets` — sync fine-grained personal access tokens as API keys `--sync-last-activity` — emit the audit-log usage event feed. Hidden from `--help` and from the GUI config here, because it only applies to GitHub Enterprise audit-log access; `baton-github-enterprise` sets it directly instead of going through this CLI layer `--omit-archived-repositories` — skip archived repositories - `--direct-collaborators-only` — reduce API calls on large organizations. Grant and revoke do not depend on this option. Grant returns `GrantAlreadyExists` when the user already has the requested permission, including through a team, the organization base permission, or organization ownership. No direct collaborator record is created in that case. Revoke removes only the direct collaborator or invitation, so inherited access stays + `--direct-collaborators-only` — reduce API calls on large organizations. Grant and revoke do not depend on this option. Grant returns `GrantAlreadyExists` only when the effective permission level is exactly the requested level. Effective access includes access through a team, the organization base permission, or organization ownership. No direct collaborator record is created in that case. If the effective level is higher or lower, Grant still adds a direct collaborator. Revoke removes only the direct collaborator or invitation, so inherited access stays 2. **For each item in the list above:** - **How does a user create or look up that credential or info?** @@ -169,7 +169,7 @@ - **Parent**: Organization - **Entitlements**: `pull`, `triage`, `push`, `maintain`, `admin` (permission), grantable to users and teams, and declared as an exclusion group because a principal holds one level at a time - **Grants**: One grant per collaborator for their permission level, and one per team with repository access. The organization's `default_repository_permission` is expanded into the cumulative levels it implies and emitted against the organization, annotated as expandable through the org's `member` and `admin` entitlements -- **Provisioning**: Grant and Revoke add or remove a collaborator, or a team's repository access. Grant skips a user who already has the requested permission through a team, the organization base permission, or organization ownership. Revoke removes only the direct collaborator or invitation +- **Provisioning**: Grant and Revoke add or remove a collaborator, or a team's repository access. Grant skips a user whose effective permission level, through a team, the organization base permission, or organization ownership, is exactly the requested level. Otherwise Grant adds a direct collaborator. Revoke removes only the direct collaborator or invitation - **Note**: `--omit-archived-repositories` skips archived repositories. `--direct-collaborators-only` relies on grant expansion for team access instead of fetching per-team detail ### Organization roles