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:
560560* ` --allow-fs-read=/home/test* ` will allow read access to everything
561561 that matches the wildcard. e.g: ` /home/test/file1 ` or ` /home/test2 `
562562
563+ After passing a wildcard character (` * ` ) all subsequent characters will
564+ be ignored. For example: ` /home/*.js ` will work similar to ` /home/* ` .
565+
563566#### Permission Model constraints
564567
565568There 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) {
107107 '--experimental-permission' ,
108108 '--allow-fs-read=/a/b/*' ,
109109 '--allow-fs-read=/a/b/d' ,
110+ '--allow-fs-read=/etc/passwd.*' ,
111+ '--allow-fs-read=/home/*.js' ,
110112 '-e' ,
111113 `
112114 const assert = require('assert')
113115 assert.ok(process.permission.has('fs.read', '/a/b/c'));
114116 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'));
115119 ` ,
116120 ]
117121 ) ;
You can’t perform that action at this time.
0 commit comments