Add 'write'
value to FileSystemHandle
permission descriptor.mode
#40535
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The File System Access API defines two access modes for file system entries: "read" and "readwrite". These modes are used when querying or requesting permission to an entry.
An issue with the current model is that operations requiring only file system modification, such as FileSystemHandle.remove(), are forced to request broad "readwrite" permission. This behavior poses some unnecessary security risks. Add a new "write"-only access mode and adjust the existing APIs would solve the issue.
Motivation
Add
'write'
value toFileSystemHandle
permissiondescriptor.mode
so developers are aware.Additional details
Related issues and pull requests
See https://chromestatus.com/feature/5324970347200512 and https://wicg.github.io/file-system-access/#enumdef-filesystempermissionmode.