Permissions
We came across Deno's permissions for the first time a few pages ago when we wrote our first HTTP server. At the time, we had to give our script permission to access the network. Since then, we've used them a few times without knowing too much about how they work.
In this section, we'll explore how permissions work. We'll learn what permissions exist and how to configure them.
If we run deno run --help
, we get the help output for the run
command, which is where, among other things, certain permissions are listed. To make this easier for you, we will list all the existing permissions and provide a brief explanation of each.
-A, --allow-all
This disables all permission checks. Running code with this flag means it will have access to everything the user has, quite similar to what happens with Node.js by default.
Be careful when you run code with this, and be especially careful when the code is not yours.
--allow-env
This grants access...