mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
doc: fix permission documentation examples
Signed-off-by: greenhead <shren0812@gmail.com> PR-URL: https://github.com/nodejs/node/pull/64897 Reviewed-By: Aviv Keller <me@aviv.sh>
This commit is contained in:
1 parent
b8faee02e1
commit
1bf7737810
1 file changed
+2
-2
@@ -133,7 +133,7 @@ const config = fs.readFileSync('/etc/myapp/config.json', 'utf8');
|
||||
// Drop read access to /etc/myapp after initialization
|
||||
process.permission.drop('fs.read', '/etc/myapp');
|
||||
|
||||
// This will now throw ERR_ACCESS_DENIED
|
||||
// This will now return false
|
||||
process.permission.has('fs.read', '/etc/myapp/config.json'); // false
|
||||
|
||||
// Drop child process permission entirely
|
||||
@@ -211,7 +211,7 @@ $ node --permission index.js
|
||||
* `index.js` will be included in the allowed file system read list
|
||||
|
||||
```console
|
||||
$ node -r /path/to/custom-require.js --permission index.js.
|
||||
$ node -r /path/to/custom-require.js --permission index.js
|
||||
```
|
||||
|
||||
* `/path/to/custom-require.js` will be included in the allowed file system read
|
||||
|
||||
Reference in new issue
Block a user