File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -560,6 +560,9 @@ Wildcards are supported too:
560
560
* ` --allow-fs-read=/home/test* ` will allow read access to everything
561
561
that matches the wildcard. e.g: ` /home/test/file1 ` or ` /home/test2 `
562
562
563
+ After passing a wildcard character (` * ` ) all subsequent characters will
564
+ be ignored. For example: ` /home/*.js ` will work similar to ` /home/* ` .
565
+
563
566
#### Permission Model constraints
564
567
565
568
There are constraints you need to know before using this system:
Original file line number Diff line number Diff line change @@ -107,11 +107,15 @@ if (common.isWindows) {
107
107
'--experimental-permission' ,
108
108
'--allow-fs-read=/a/b/*' ,
109
109
'--allow-fs-read=/a/b/d' ,
110
+ '--allow-fs-read=/etc/passwd.*' ,
111
+ '--allow-fs-read=/home/*.js' ,
110
112
'-e' ,
111
113
`
112
114
const assert = require('assert')
113
115
assert.ok(process.permission.has('fs.read', '/a/b/c'));
114
116
assert.ok(!process.permission.has('fs.read', '/a/c/c'));
117
+ assert.ok(!process.permission.has('fs.read', '/etc/passwd'));
118
+ assert.ok(process.permission.has('fs.read', '/home/another-file.md'));
115
119
` ,
116
120
]
117
121
) ;
You can’t perform that action at this time.
0 commit comments