Skip to content

Add per-command org-member permissions#542

Draft
timja with Copilot wants to merge 2 commits into
mainfrom
copilot/allow-restricting-to-org-members
Draft

Add per-command org-member permissions#542
timja with Copilot wants to merge 2 commits into
mainfrom
copilot/allow-restricting-to-org-members

Conversation

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

This adds optional command-level permission controls so repositories can restrict specific comment-ops commands to organization members. By default, commands remain open to all commenters, preserving current behavior.

  • Per-command permission model

    • Add permission to each command config
    • Support:
      • all (default): any commenter may invoke the command
      • member: only org MEMBER and OWNER authors may invoke the command
  • Authorization enforcement

    • Extend command enablement checks to evaluate the comment/review author's GitHub author_association
    • Apply permission checks consistently across all supported commands:
      • close
      • reopen
      • label
      • remove-label
      • reviewer
      • transfer
  • Config and docs

    • Update default config to include permission: all
    • Document the new option in the README with supported values and behavior
  • Test coverage

    • Add focused tests for:
      • default behavior when permission is unset
      • member access for org members/owners
      • denial for non-members
      • extraction of author association from webhook payloads

Example configuration:

commands:
  label:
    enabled: true
    permission: member
    allowedLabels: [bug, chore, enhancement]

  close:
    enabled: true
    permission: all

Copilot AI linked an issue Jul 25, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add option to restrict commands to org members Add per-command org-member permissions Jul 25, 2026
Copilot finished work on behalf of timja July 25, 2026 08:03
Copilot AI requested a review from timja July 25, 2026 08:03
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.

Allow restricting to org members

2 participants