Skip to content

Commit

Permalink
doc: improve permission.has description
Browse files Browse the repository at this point in the history
This fixes the function description and adds missing available scopes.

Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
PR-URL: #47875
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
daeyeon authored and targos committed May 12, 2023
1 parent 515c9b8 commit 4dfc389
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/api/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()`][])

Expand Down
4 changes: 3 additions & 1 deletion doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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
Expand Down

0 comments on commit 4dfc389

Please sign in to comment.