How to set file access rights using Node.js on Windows?

Viewed 389

To setup who can access what file, Node.js's fs module provides a number of functions, such as chown.

While this works pretty well on macOS and Linux, it is rather a workaround than a solution on Windows, as Windows does not support such fine-granular permissions on the file system level. However, I know that using the properties dialog in Windows Explorer you can assign permissions to users and groups.

How can I adjust this using Node.js? Apparently, chown and co. do not perform this task, do they?

PS: Of course I can run icacls using a shell command, but I thought that there might be a better way. Is there?

0 Answers
Related