Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions runtime/fundamentals/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,22 @@ import * as module_2 from "@example/my-package/module2";

## Permissions

Deno 2.5+ supports storing permission sets in the config file.
Deno 2.5+ supports storing
[permission](/runtime/fundamentals/security/#permissions) sets in the config
file.

### Named permissions

Permissions can be defined in key value pairs under the `"permissions"` key:
Permissions can be defined as key-value pairs under arbitrarily-named permission
sets under the `"permissions"` key. Within each set,

- the key is the name of a
[permission](/runtime/fundamentals/security/#permissions) that would follow
`--allow-` or `--deny-` in the CLI invocation (i.e. `read`, `write`, `net`,
`env`, `sys`, `run`, `ffi`, `import`)
- the value is a boolean (`true` / `false` correspond to allow / deny), an array
of strings representing paths, domains etc., or an object with `allow`,
`deny`, and/or `ignore` boolean key-value pairs.

```jsonc
{
Expand All @@ -547,7 +558,8 @@ Permissions can be defined in key value pairs under the `"permissions"` key:
}
```

Then used by specifying the `--permission-set=<name>` or `-P=<name>` flag:
Permission sets can be used by specifying the `--permission-set=<name>` or
`-P=<name>` flag:

```sh
$ deno run -P=read-data main.ts
Expand Down