summaryrefslogtreecommitdiff
path: root/runtime/permissions.rs
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/permissions.rs')
-rw-r--r--runtime/permissions.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/runtime/permissions.rs b/runtime/permissions.rs
index f8385e201..d78e20076 100644
--- a/runtime/permissions.rs
+++ b/runtime/permissions.rs
@@ -962,6 +962,23 @@ impl Permissions {
}
}
+impl deno_net::NetPermissions for Permissions {
+ fn check_net<T: AsRef<str>>(
+ &mut self,
+ host: &(T, Option<u16>),
+ ) -> Result<(), AnyError> {
+ self.net.check(host)
+ }
+
+ fn check_read(&mut self, path: &Path) -> Result<(), AnyError> {
+ self.read.check(path)
+ }
+
+ fn check_write(&mut self, path: &Path) -> Result<(), AnyError> {
+ self.write.check(path)
+ }
+}
+
impl deno_fetch::FetchPermissions for Permissions {
fn check_net_url(&mut self, url: &url::Url) -> Result<(), AnyError> {
self.net.check_url(url)