From 7622dd8c3d41f8de82b82808cd07db1e79c8b6b4 Mon Sep 17 00:00:00 2001 From: jakecastelli <38635403+jakecastelli@users.noreply.github.com> Date: Fri, 5 Jul 2024 03:00:07 +0930 Subject: [PATCH] doc: add additional explanation to the wildcard section in permissions Co-authored-by: Rafael Gonzaga PR-URL: https://github.com/nodejs/node/pull/53664 Reviewed-By: Rafael Gonzaga Reviewed-By: James M Snell Reviewed-By: Marco Ippolito --- doc/api/permissions.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/api/permissions.md b/doc/api/permissions.md index d994035c808818..ceecd39ae66043 100644 --- a/doc/api/permissions.md +++ b/doc/api/permissions.md @@ -563,6 +563,14 @@ Wildcards are supported too: After passing a wildcard character (`*`) all subsequent characters will be ignored. For example: `/home/*.js` will work similar to `/home/*`. +When the permission model is initialized, it will automatically add a wildcard +(\*) if the specified directory exists. For example, if `/home/test/files` +exists, it will be treated as `/home/test/files/*`. However, if the directory +does not exist, the wildcard will not be added, and access will be limited to +`/home/test/files`. If you want to allow access to a folder that does not exist +yet, make sure to explicitly include the wildcard: +`/my-path/folder-do-not-exist/*`. + #### Permission Model constraints There are constraints you need to know before using this system: