Skip to content

Require committer access on either side of /transfer#540

Draft
timja with Copilot wants to merge 3 commits into
mainfrom
copilot/require-committer-access-issue-transfers
Draft

Require committer access on either side of /transfer#540
timja with Copilot wants to merge 3 commits into
mainfrom
copilot/require-committer-access-issue-transfers

Conversation

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Issue transfers were previously attempted without checking the commenter’s repository role, which allowed non-committers to invoke /transfer until GitHub rejected it downstream. This change enforces app-level authorization: transfer is allowed only when the actor has committer-level access on the source or destination repo.

  • Authorization gate for issue transfer

    • Added a permission check in transferIssue(...) before the transfer mutation runs.
    • Commiter-equivalent permissions are treated as: WRITE, MAINTAIN, ADMIN.
    • Transfer is blocked unless at least one side (source or target) grants committer access.
  • Transfer flow wiring

    • Updated TransferCommand to pass payload.sender.login into transferIssue(...) so checks are evaluated against the command actor.
  • Behavioral documentation

    • Updated /transfer docs to state that users must have committer access on either source or destination repository.
  • Focused unit coverage

    • Added unit tests for the permission decision helper to cover allow/deny cases across permission combinations.
if (
  !hasCommitterAccess(
    getCollaboratorPermission(source, username),
    getCollaboratorPermission(target, username),
  )
) {
  throw new Error(
    `User ${username} requires committer access on ${sourceRepo} or ${targetRepo} to transfer issues`,
  );
}

@comment-ops-bot

Copy link
Copy Markdown

The transfer command is not enabled for this repository

@comment-ops-bot

Copy link
Copy Markdown

The transfer command is not enabled for this repository

1 similar comment
@comment-ops-bot

Copy link
Copy Markdown

The transfer command is not enabled for this repository

Copilot AI changed the title [WIP] Restrict issue transfers to committers on source or destination Require committer access on either side of /transfer Jul 25, 2026
Copilot finished work on behalf of timja July 25, 2026 08:01
Copilot AI requested a review from timja July 25, 2026 08:01
Copilot finished work on behalf of timja July 25, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Require committer access on either end of issue transfers

2 participants