Skip to content

Commit

Permalink
BREAKING: don't inherit permissions by default (#13668)
Browse files Browse the repository at this point in the history
Previously specifying permissions: {} was the same as specifying
permissions: "inherit". Now it will be the same as permissions: "none".
Not specifying any permissions (permissions: undefined) still means
permissions: "inherit".
  • Loading branch information
lucacasonato committed Mar 16, 2022
1 parent bd481bf commit a7bef54
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions cli/dts/lib.deno.ns.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ declare namespace Deno {
* If set to `true`, the global `net` permission will be requested.
* If set to `false`, the global `net` permission will be revoked.
*
* Defaults to "inherit".
* Defaults to `false`.
*/
env?: "inherit" | boolean | string[];

Expand All @@ -131,7 +131,7 @@ declare namespace Deno {
* If set to `true`, the global `hrtime` permission will be requested.
* If set to `false`, the global `hrtime` permission will be revoked.
*
* Defaults to "inherit".
* Defaults to `false`.
*/
hrtime?: "inherit" | boolean;

Expand All @@ -142,7 +142,7 @@ declare namespace Deno {
* if set to `string[]`, the `net` permission will be requested with the
* specified host strings with the format `"<host>[:<port>]`.
*
* Defaults to "inherit".
* Defaults to `false`.
*
* Examples:
*
Expand Down Expand Up @@ -213,7 +213,7 @@ declare namespace Deno {
* If set to `true`, the global `ffi` permission will be requested.
* If set to `false`, the global `ffi` permission will be revoked.
*
* Defaults to "inherit".
* Defaults to `false`.
*/
ffi?: "inherit" | boolean | Array<string | URL>;

Expand All @@ -224,7 +224,7 @@ declare namespace Deno {
* If set to `Array<string | URL>`, the `read` permission will be requested with the
* specified file paths.
*
* Defaults to "inherit".
* Defaults to `false`.
*/
read?: "inherit" | boolean | Array<string | URL>;

Expand All @@ -233,7 +233,7 @@ declare namespace Deno {
* If set to `true`, the global `run` permission will be requested.
* If set to `false`, the global `run` permission will be revoked.
*
* Defaults to "inherit".
* Defaults to `false`.
*/
run?: "inherit" | boolean | Array<string | URL>;

Expand All @@ -244,7 +244,7 @@ declare namespace Deno {
* If set to `Array<string | URL>`, the `write` permission will be requested with the
* specified file paths.
*
* Defaults to "inherit".
* Defaults to `false`.
*/
write?: "inherit" | boolean | Array<string | URL>;
}
Expand Down
4 changes: 2 additions & 2 deletions runtime/permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@ impl<'de> Deserialize<'de> for ChildUnitPermissionArg {
where
E: de::Error,
{
Ok(ChildUnitPermissionArg::Inherit)
Ok(ChildUnitPermissionArg::NotGranted)
}

fn visit_str<E>(self, v: &str) -> Result<ChildUnitPermissionArg, E>
Expand Down Expand Up @@ -1514,7 +1514,7 @@ impl<'de> Deserialize<'de> for ChildUnaryPermissionArg {
where
E: de::Error,
{
Ok(ChildUnaryPermissionArg::Inherit)
Ok(ChildUnaryPermissionArg::NotGranted)
}

fn visit_str<E>(self, v: &str) -> Result<ChildUnaryPermissionArg, E>
Expand Down

0 comments on commit a7bef54

Please sign in to comment.