Skip to content

Commit 8462363

Browse files
RafaelGSSrichardlau
authored andcommitted
doc: document URL and Uint8Array references in process.permission
This was missed in #65492. Signed-off-by: RafaelGSS <[email protected]> PR-URL: #66557 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ulises Gascón <[email protected]>
1 parent 5fd03e6 commit 8462363

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

‎doc/api/process.md‎

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3139,10 +3139,14 @@ for the current process. Additional documentation is available in the
31393139
31403140
<!-- YAML
31413141
added: v20.0.0
3142+
changes:
3143+
- version: REPLACEME
3144+
pr-url: https://github.com/nodejs/node/pull/65492
3145+
description: The `reference` argument can be a `URL` or a `Uint8Array`.
31423146
-->
31433147
31443148
* `scope` {string}
3145-
* `reference` {string}
3149+
* `reference` {string|URL|Uint8Array}
31463150
* Returns: {boolean}
31473151
31483152
Verifies that the process is able to access the given scope and reference.
@@ -3156,6 +3160,10 @@ permission status, but denied operations will not throw `ERR_ACCESS_DENIED`.
31563160
The reference has a meaning based on the provided scope. For example,
31573161
the reference when the scope is File System means files and folders.
31583162
3163+
For File System scopes, a `URL` reference must use the `file:` protocol and is
3164+
converted to a path, while a `Uint8Array` reference is treated as the raw bytes
3165+
of a path. Other scopes ignore the reference.
3166+
31593167
The available scopes are:
31603168
31613169
* `fs` - All File System
@@ -3164,6 +3172,10 @@ The available scopes are:
31643172
* `child` - Child process spawning operations
31653173
* `openssl.store` - Loading keys through OpenSSL STORE loaders
31663174
* `worker` - Worker thread spawning operation
3175+
* `net` - Network operations
3176+
* `inspector` - Inspector operations
3177+
* `wasi` - WASI operations
3178+
* `addon` - Native addon operations
31673179
* `ffi` - Foreign function interface operations
31683180
31693181
```js
@@ -3176,13 +3188,19 @@ process.permission.has('fs.read');
31763188
### `process.permission.drop(scope[, reference])`
31773189
31783190
<!-- YAML
3179-
added: v26.3.0
3191+
added:
3192+
- v26.3.0
3193+
- v24.20.0
3194+
changes:
3195+
- version: REPLACEME
3196+
pr-url: https://github.com/nodejs/node/pull/65492
3197+
description: The `reference` argument can be a `URL` or a `Uint8Array`.
31803198
-->
31813199
31823200
> Stability: 1.1 - Active Development
31833201
31843202
* `scope` {string}
3185-
* `reference` {string}
3203+
* `reference` {string|URL|Uint8Array}
31863204
31873205
Drops the specified permission from the current process. This operation is
31883206
**irreversible** — once a permission is dropped, it cannot be restored through
@@ -3223,6 +3241,7 @@ The available scopes are the same as [`process.permission.has()`][]:
32233241
* `inspector` - Inspector operations
32243242
* `wasi` - WASI operations
32253243
* `addon` - Native addon operations
3244+
* `ffi` - Foreign function interface operations
32263245
32273246
```js
32283247
const fs = require('node:fs');

0 commit comments

Comments
 (0)