doc: describe how the permission model grants the entrypoint

Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/67038
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
This commit is contained in:
Rafael Gonzaga authored and Antoine du Hamel committed 2026-11-12 18:00:37 +01:00
1 parent b4afb79d69
commit 97dfaed090
3 files changed
+15 -4

No files matched your search

+4 -2
View File
@@ -252,8 +252,10 @@ The valid arguments for the `--allow-fs-read` flag are:
Examples can be found in the [File System Permissions][] documentation.
The initializer module and custom `--require` modules has a implicit
read permission.
The initializer module and custom `--require` modules have an implicit
read permission. The entrypoint is granted as passed on the command line,
without the module loader's resolution; see the [File System Permissions][]
documentation for details.
```console
$ node --permission -r custom-require.js -r custom-require-2.js index.js
+7
View File
@@ -226,6 +226,13 @@ $ node -r /path/to/custom-require.js --permission index.js
list.
* `index.js` will be included in the allowed file system read list.
The entrypoint is granted as passed on the command line, without the module
loader's resolution. If it is a directory, such as in `node --permission .`,
read access is granted to everything inside that directory, recursively. If it
omits the file extension, such as in `node --permission index`, the resolved
`index.js` is not granted. Pass the full path of the file, or use
[`--allow-fs-read`][], to grant exactly what the application needs.
The valid arguments for both flags are:
* `*` - To allow all `FileSystemRead` or `FileSystemWrite` operations,
+4 -2
View File
@@ -150,8 +150,10 @@ Multiple paths can be allowed using multiple \fB--allow-fs-read\fR flags.
Example \fB--allow-fs-read=/folder1/ --allow-fs-read=/folder2/\fR
.El
Examples can be found in the File System Permissions documentation.
The initializer module and custom \fB--require\fR modules has a implicit
read permission.
The initializer module and custom \fB--require\fR modules have an implicit
read permission. The entrypoint is granted as passed on the command line,
without the module loader's resolution; see the File System Permissions
documentation for details.
.Bd -literal
$ node --permission -r custom-require.js -r custom-require-2.js index.js
.Ed