mirror of
https://github.com/denoland/deno.git
synced 2024-11-22 15:06:54 -05:00
docs: update permissions docs (#5426)
This commit is contained in:
parent
6f52ad9052
commit
0f1c66cb6d
1 changed files with 12 additions and 2 deletions
|
@ -27,12 +27,22 @@ $ deno run --allow-read=/etc https://deno.land/std/examples/cat.ts /etc/passwd
|
|||
|
||||
`--allow-write` works the same as `--allow-read`.
|
||||
|
||||
This example restricts network access by whitelisting the allowed hosts:
|
||||
### Network access:
|
||||
|
||||
_fetch.ts_:
|
||||
|
||||
```ts
|
||||
const result = await fetch("https://deno.land/");
|
||||
```
|
||||
|
||||
This is an example on how to whitelist hosts/urls:
|
||||
|
||||
```shell
|
||||
$ deno run --allow-net=deno.land https://deno.land/std/examples/curl.ts https://deno.land/
|
||||
$ deno run --allow-net=github.com,deno.land fetch.ts
|
||||
```
|
||||
|
||||
Allow net calls to any host/url:
|
||||
|
||||
```shell
|
||||
$ deno run --allow-net fetch.ts
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue