@@ -126,7 +126,7 @@ require('nodejs-addon-example'); |
126 | 126 | ``` |
127 | 127 |
|
128 | 128 | ```console |
129 | | -$ node --experimental-permission --allow-fs-read=* index.js |
| 129 | +$ node --permission --allow-fs-read=* index.js |
130 | 130 | node:internal/modules/cjs/loader:1319 |
131 | 131 | return process.dlopen(module, path.toNamespacedPath(filename)); |
132 | 132 | ^ |
@@ -168,7 +168,7 @@ childProcess.spawn('node', ['-e', 'require("fs").writeFileSync("/new-file", "exa |
168 | 168 | ``` |
169 | 169 |
|
170 | 170 | ```console |
171 | | -$ node --experimental-permission --allow-fs-read=* index.js |
| 171 | +$ node --permission --allow-fs-read=* index.js |
172 | 172 | node:internal/child_process:388 |
173 | 173 | const err = this._handle.spawn(options); |
174 | 174 | ^ |
@@ -192,12 +192,15 @@ Error: Access to this API has been restricted |
192 | 192 | <!-- YAML |
193 | 193 | added: v20.0.0 |
194 | 194 | changes: |
| 195 | + - version: REPLACEME |
| 196 | + pr-url: https://github.com/nodejs/node/pull/56201 |
| 197 | + description: Permission Model and --allow-fs flags are stable. |
195 | 198 | - version: v20.7.0 |
196 | 199 | pr-url: https://github.com/nodejs/node/pull/49047 |
197 | 200 | description: Paths delimited by comma (`,`) are no longer allowed. |
198 | 201 | --> |
199 | 202 |
|
200 | | -> Stability: 1.1 - Active development |
| 203 | +> Stability: 2 - Stable. |
201 | 204 |
|
202 | 205 | This flag configures file system read permissions using |
203 | 206 | the [Permission Model][]. |
@@ -213,7 +216,7 @@ Examples can be found in the [File System Permissions][] documentation. |
213 | 216 | The initializer module also needs to be allowed. Consider the following example: |
214 | 217 |
|
215 | 218 | ```console |
216 | | -$ node --experimental-permission index.js |
| 219 | +$ node --permission index.js |
217 | 220 |
|
218 | 221 | Error: Access to this API has been restricted |
219 | 222 | at node:internal/main/run_main_module:23:47 { |
@@ -226,20 +229,23 @@ Error: Access to this API has been restricted |
226 | 229 | The process needs to have access to the `index.js` module: |
227 | 230 |
|
228 | 231 | ```bash |
229 | | -node --experimental-permission --allow-fs-read=/path/to/index.js index.js |
| 232 | +node --permission --allow-fs-read=/path/to/index.js index.js |
230 | 233 | ``` |
231 | 234 |
|
232 | 235 | ### `--allow-fs-write` |
233 | 236 |
|
234 | 237 | <!-- YAML |
235 | 238 | added: v20.0.0 |
236 | 239 | changes: |
| 240 | + - version: REPLACEME |
| 241 | + pr-url: https://github.com/nodejs/node/pull/56201 |
| 242 | + description: Permission Model and --allow-fs flags are stable. |
237 | 243 | - version: v20.7.0 |
238 | 244 | pr-url: https://github.com/nodejs/node/pull/49047 |
239 | 245 | description: Paths delimited by comma (`,`) are no longer allowed. |
240 | 246 | --> |
241 | 247 |
|
242 | | -> Stability: 1.1 - Active development |
| 248 | +> Stability: 2 - Stable. |
243 | 249 |
|
244 | 250 | This flag configures file system write permissions using |
245 | 251 | the [Permission Model][]. |
@@ -283,7 +289,7 @@ new WASI({ |
283 | 289 | ``` |
284 | 290 |
|
285 | 291 | ```console |
286 | | -$ node --experimental-permission --allow-fs-read=* index.js |
| 292 | +$ node --permission --allow-fs-read=* index.js |
287 | 293 |
|
288 | 294 | Error: Access to this API has been restricted |
289 | 295 | at node:internal/main/run_main_module:30:49 { |
@@ -314,7 +320,7 @@ new Worker(__filename); |
314 | 320 | ``` |
315 | 321 |
|
316 | 322 | ```console |
317 | | -$ node --experimental-permission --allow-fs-read=* index.js |
| 323 | +$ node --permission --allow-fs-read=* index.js |
318 | 324 |
|
319 | 325 | Error: Access to this API has been restricted |
320 | 326 | at node:internal/main/run_main_module:17:47 { |
@@ -970,24 +976,6 @@ added: |
970 | 976 |
|
971 | 977 | Enable experimental support for the network inspection with Chrome DevTools. |
972 | 978 |
|
973 | | -### `--experimental-permission` |
974 | | - |
975 | | -<!-- YAML |
976 | | -added: v20.0.0 |
977 | | ---> |
978 | | - |
979 | | -> Stability: 1.1 - Active development |
980 | | -
|
981 | | -Enable the Permission Model for current process. When enabled, the |
982 | | -following permissions are restricted: |
983 | | - |
984 | | -* File System - manageable through |
985 | | - [`--allow-fs-read`][], [`--allow-fs-write`][] flags |
986 | | -* Child Process - manageable through [`--allow-child-process`][] flag |
987 | | -* Worker Threads - manageable through [`--allow-worker`][] flag |
988 | | -* WASI - manageable through [`--allow-wasi`][] flag |
989 | | -* Addons - manageable through [`--allow-addons`][] flag |
990 | | - |
991 | 979 | ### `--experimental-print-required-tla` |
992 | 980 |
|
993 | 981 | <!-- YAML |
@@ -1807,6 +1795,28 @@ unless either the `--pending-deprecation` command-line flag, or the |
1807 | 1795 | are used to provide a kind of selective "early warning" mechanism that |
1808 | 1796 | developers may leverage to detect deprecated API usage. |
1809 | 1797 |
|
| 1798 | +### `--permission` |
| 1799 | + |
| 1800 | +<!-- YAML |
| 1801 | +added: v20.0.0 |
| 1802 | +changes: |
| 1803 | + - version: REPLACEME |
| 1804 | + pr-url: https://github.com/nodejs/node/pull/56201 |
| 1805 | + description: Permission Model is now stable. |
| 1806 | +--> |
| 1807 | + |
| 1808 | +> Stability: 2 - Stable. |
| 1809 | +
|
| 1810 | +Enable the Permission Model for current process. When enabled, the |
| 1811 | +following permissions are restricted: |
| 1812 | + |
| 1813 | +* File System - manageable through |
| 1814 | + [`--allow-fs-read`][], [`--allow-fs-write`][] flags |
| 1815 | +* Child Process - manageable through [`--allow-child-process`][] flag |
| 1816 | +* Worker Threads - manageable through [`--allow-worker`][] flag |
| 1817 | +* WASI - manageable through [`--allow-wasi`][] flag |
| 1818 | +* Addons - manageable through [`--allow-addons`][] flag |
| 1819 | + |
1810 | 1820 | ### `--preserve-symlinks` |
1811 | 1821 |
|
1812 | 1822 | <!-- YAML |
@@ -3145,6 +3155,7 @@ one is included in the list below. |
3145 | 3155 | * `--openssl-legacy-provider` |
3146 | 3156 | * `--openssl-shared-config` |
3147 | 3157 | * `--pending-deprecation` |
| 3158 | +* `--permission` |
3148 | 3159 | * `--preserve-symlinks-main` |
3149 | 3160 | * `--preserve-symlinks` |
3150 | 3161 | * `--prof-process` |
|