doc: improve permission.has description

This fixes the function description and adds missing available scopes.

Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/47875
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Daeyeon Jeong authored and GitHub committed 2023-05-07 10:08:21 +00:00
1 parent 39973c6498
commit 9f39a9d2cb
2 files changed
+4 -2

No files matched your search

+1 -1
View File
@@ -494,7 +494,7 @@ When enabling the Permission Model through the [`--experimental-permission`][]
flag a new property `permission` is added to the `process` object.
This property contains one function:
##### `permission.has(scope ,parameters)`
##### `permission.has(scope[, reference])`
API call to check permissions at runtime ([`permission.has()`][])
+3 -1
View File
@@ -2640,7 +2640,7 @@ for the current process. Additional documentation is available in the
added: v20.0.0
-->
* `scopes` {string}
* `scope` {string}
* `reference` {string}
* Returns: {boolean}
@@ -2657,6 +2657,8 @@ The available scopes are:
* `fs` - All File System
* `fs.read` - File System read operations
* `fs.write` - File System write operations
* `child` - Child process spawning operations
* `worker` - Worker thread spawning operation
```js
// Check if the process has permission to read the README file