Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/fix-fs-write-sets-open.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
fs: patch
fs-js: patch
---

The `write-all` and `write-files` permissions (and so every `allow-*-write[-recursive]` set) now also allow the `open`, `seek` and `fstat` commands. `writeFile` with a `ReadableStream` uses `open` and failed with "not allowed" under these sets, and the `FileHandle` returned by `create` could not `seek` or `stat`.
4 changes: 4 additions & 0 deletions plugins/fs/permissions/write-all.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ commands.allow = [
"write",
"write_file",
"write_text_file",
# used by `writeFile` with a stream and by the `FileHandle` returned by `create` and `open`
"open",
"seek",
"fstat",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to introduce permission dependencies? when a plugin defines its commands

[
  ("writeFile", ["open", "seek", "fstat"]),
  ("readFile"), []),
]

]
4 changes: 4 additions & 0 deletions plugins/fs/permissions/write-files.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ commands.allow = [
"write",
"write_file",
"write_text_file",
# used by `writeFile` with a stream and by the `FileHandle` returned by `create` and `open`
"open",
"seek",
"fstat",
]
Loading