Skip to content

Commit d6da413

Browse files
committed
1 parent d01dd42 commit d6da413

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

doc/api/permissions.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,10 @@ Wildcards are supported too:
557557
* `--allow-fs-read=/home/test*` will allow read access to everything
558558
that matches the wildcard. e.g: `/home/test/file1` or `/home/test2`
559559

560-
#### Limitations and known issues
560+
After passing a wildcard character (`*`) all subsequent characters will
561+
be ignored. For example: `/home/*.js` will work similar to `/home/*`.
562+
563+
#### Permission Model constraints
561564

562565
There are constraints you need to know before using this system:
563566

test/parallel/test-permission-fs-wildcard.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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
);

0 commit comments

Comments
 (0)