Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 7 additions & 1 deletion doc/api/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,13 @@ easy to configure permissions as needed when using `npx`.

There are constraints you need to know before using this system:

* The model does not inherit to a worker thread.
* The model does not inherit to a worker thread. A default
`worker_threads.Worker` (no `execArgv` option) still receives the parent
process CLI flags, including `--permission` and `--allow-*` if those were
passed to the parent. Setting `execArgv` explicitly, including
`execArgv: []`, replaces the inherited flags. The worker then does not keep
the parent's Permission Model grants unless those flags are listed again in
`execArgv`. That difference is intended, not a bypass.
* When using the Permission Model the following features will be restricted:
* Native modules
* Network
Expand Down
6 changes: 6 additions & 0 deletions doc/api/worker_threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -1631,6 +1631,12 @@ changes:
process (such as `--title`) are not supported. If set, this is provided
as [`process.execArgv`][] inside the worker. By default, options are
inherited from the parent thread.
Passing an explicit `execArgv` (including an empty array) replaces that
inheritance: the worker receives only the listed flags. Under the
[Permission Model](permissions.md#permission-model), that means an explicit
`execArgv` can drop the parent's `--permission` / `--allow-*` grants.
Omit `execArgv` to keep the parent's CLI flags. This is intended. See
[Permission Model limitations](permissions.md#limitations-and-known-issues).
* `stdin` {boolean} If this is set to `true`, then `worker.stdin`
provides a writable stream whose contents appear as `process.stdin`
inside the Worker. By default, no data is provided.
Expand Down
Loading