-
Notifications
You must be signed in to change notification settings - Fork 6.4k
feat: Permissions dialog #8859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
feat: Permissions dialog #8859
Conversation
…cused When a textarea is focused inside a dialog, pressing escape should only affect the textarea (e.g., exit edit mode), not close the entire dialog. Previously, escape would always close the dialog, making it impossible to cancel textarea edits without losing the entire dialog state. This fix checks if the currently focused element is a TextareaRenderable and skips dialog close handling if so, allowing the textarea's own escape handler to run first.
- Add full CRUD dialog for viewing/editing/creating/deleting permissions - Add 'View permissions' command to command palette - Add backend CRUD operations: approved(), remove(), update(), add() - Add API endpoints: GET/DELETE/PUT/POST /permission/approved - Contextual help tips for file patterns and bash wildcards - Keybindings: tab/shift-tab for tabs, up/down for actions, e/n/d for edit/new/delete - Regenerate SDK with new permission endpoints
- Add unified permissions dialog showing all sources (default, global, project, session) - Add full CRUD for project and global permissions with inline confirmation - Add permission.all() API to fetch permissions from all sources with metadata - Add project/global permission config file writers - Add debug command to inspect permission hierarchy - Enforce binary permissions (*-only pattern) at project/global level - Hide internal permissions (todowrite, todoread, lsp) from UI - Remove 'Other' tab, keeping only File, Execute, Network, External tabs API endpoints: - GET /permission/all - fetch all permissions with source metadata - PUT/DELETE /permission/project - manage project config - PUT/DELETE /permission/global - manage global config (~/.config/opencode/opencode.json) UI features: - Source badges: [default], [global], [project], (none for session) - Inline confirmation preserves dialog state - Ctrl+P to cycle source when creating: session → project → global - Binary permissions auto-lock pattern to '*' at project/global level - Clear warnings for global changes (affects ALL projects)
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
7a143eb to
f5b9915
Compare
What does this PR do?
Fixes #3261
Happy for feedback/pushback, implemented the way I would I have liked it, but it doesn't mean it fits everyone.
First, fixed small bug in TUI, causing edit-cancel to exit the dialog
Created a "permissions" dialog that shows the permissions from:
opencode.json)~/.config/opencode/opencode.json)1-3 are editable (CRUD) in the dialog. 2-3 show confirmations prompts when writing.
Changes are persisted to the relevant files.
Small hint on how execute perms work with wildcards
Added debug command to show permissions for a quicker feedback loop.
How did you verify your code works?
Tested locally with the following:
Screenshots from







bun dev:When editing
When editing a non-session permission, after pressing enter