Skip to content

Refine PR merge and branch update permissions#114

Merged
stylessh merged 3 commits into
stylessh:mainfrom
kovsu:refine-pr-merge-update-permissions
Apr 14, 2026
Merged

Refine PR merge and branch update permissions#114
stylessh merged 3 commits into
stylessh:mainfrom
kovsu:refine-pr-merge-update-permissions

Conversation

@kovsu
Copy link
Copy Markdown
Contributor

@kovsu kovsu commented Apr 14, 2026

Summary

The merge status card shows the merge button to all users regardless of their repository permissions. Users without write access see an active merge button that only fails server-side on click. This PR adds a canMerge permission check so the UI disables the button upfront and shows a clear message.

Also fixes canUpdateBranch to account for PR authorship — the PR author can update their own branch without needing push access to the base repo.

Changes

  • Add canMerge field computed from repository permissions (push/admin) in computePullStatus
  • Fix canUpdateBranch to also allow PR authors to update their own branch

Test Plan

  • User with write access sees enabled merge button and can merge
  • User with read-only access sees disabled merge button with permission message
  • PR author without base repo push access can still update branch

Screenshots

Before After
CleanShot 2026-04-14 at 11 56 01@2x CleanShot 2026-04-14 at 11 54 34@2x

Copy link
Copy Markdown
Owner

Fantastic @kovsu, will review later

@stylessh stylessh merged commit 854ac35 into stylessh:main Apr 14, 2026
1 check passed
@kovsu kovsu deleted the refine-pr-merge-update-permissions branch April 15, 2026 00:20
stylessh added a commit that referenced this pull request Apr 18, 2026
* Refine PR merge and branch update permissions

* show/hide bypass check based on met criterias

---------

Co-authored-by: Alan Daniel <stylesshjs@gmail.com>
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.

2 participants