diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-09-16 21:39:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-16 21:39:37 +0100 |
commit | 62e952559f600e72d7498c9b12f906cb0b1ba150 (patch) | |
tree | 6dbcce6592973358ef4bf6341888b0bbbdb98cc5 /runtime/examples/extension/main.rs | |
parent | e0b9c745c15720914f14996bf357d5b375e2dbd8 (diff) |
refactor(permissions): split up Descriptor into Allow, Deny, and Query (#25508)
This makes the permission system more versatile.
Diffstat (limited to 'runtime/examples/extension/main.rs')
-rw-r--r-- | runtime/examples/extension/main.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/examples/extension/main.rs b/runtime/examples/extension/main.rs index 4339bdf67..6f4f02508 100644 --- a/runtime/examples/extension/main.rs +++ b/runtime/examples/extension/main.rs @@ -5,12 +5,15 @@ use std::path::Path; use std::rc::Rc; +use std::sync::Arc; use deno_core::error::AnyError; use deno_core::op2; use deno_core::FsModuleLoader; use deno_core::ModuleSpecifier; +use deno_fs::RealFs; use deno_runtime::deno_permissions::PermissionsContainer; +use deno_runtime::permissions::RuntimePermissionDescriptorParser; use deno_runtime::worker::MainWorker; use deno_runtime::worker::WorkerOptions; @@ -34,7 +37,9 @@ async fn main() -> Result<(), AnyError> { eprintln!("Running {main_module}..."); let mut worker = MainWorker::bootstrap_from_options( main_module.clone(), - PermissionsContainer::allow_all(), + PermissionsContainer::allow_all(Arc::new( + RuntimePermissionDescriptorParser::new(Arc::new(RealFs)), + )), WorkerOptions { module_loader: Rc::new(FsModuleLoader), extensions: vec![hello_runtime::init_ops_and_esm()], |