Skip to content

Paths in edit permissions don't work well for teams with varying paths #13888

@jcowles

Description

@jcowles

Description

If you're a team of people with your code at different paths and want to allow a specific path to be edited, you can do it like this:

    "edit": {
      "*": "ask",
      "some\\path\\to\\file\\**": "allow",
    },
```

But this doesn't work, because edit has workspace path (without drive letter) prefixed, like this `src\\some\\path\\to\\file\\file.txt`, so the only solution is to prefix the path with `**` but that's not the same permission I stated above, because it matches ANY prefix to the path.


### Plugins

_No response_

### OpenCode version

1.50.0

### Steps to reproduce

add this to your config
//
    "edit": {
      "*": "ask",
      "test\\**": "allow",
    },
```

run `opencode run "write the word FOO to test/permissions.txt"`

This command will fail, reporting that the permission required "ask" access and was auto-rejected, despite explicitly setting it to "Allow" above.

### Screenshot and/or share link

_No response_

### Operating System

Windows 11

### Terminal

WezTerm

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwindows

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions