diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-09-27 22:36:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-27 22:36:33 +0200 |
commit | 212b7dd6da487c070229b6348ec7907b4fecbcf9 (patch) | |
tree | 3eb743f90e8b293182a830722eb4ff26bec72039 /runtime/ops/process.rs | |
parent | a344368603063bcb281e743f3810ca1e4e46e85d (diff) |
feat: Add requesting API name to permission prompt (#15936)
Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
Diffstat (limited to 'runtime/ops/process.rs')
-rw-r--r-- | runtime/ops/process.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/runtime/ops/process.rs b/runtime/ops/process.rs index e4b614030..88c130e61 100644 --- a/runtime/ops/process.rs +++ b/runtime/ops/process.rs @@ -144,7 +144,10 @@ struct RunInfo { #[op] fn op_run(state: &mut OpState, run_args: RunArgs) -> Result<RunInfo, AnyError> { let args = run_args.cmd; - state.borrow_mut::<Permissions>().run.check(&args[0])?; + state + .borrow_mut::<Permissions>() + .run + .check(&args[0], Some("Deno.run()"))?; let env = run_args.env; let cwd = run_args.cwd; @@ -348,8 +351,12 @@ fn op_kill( state: &mut OpState, pid: i32, signal: String, + api_name: String, ) -> Result<(), AnyError> { - state.borrow_mut::<Permissions>().run.check_all()?; + state + .borrow_mut::<Permissions>() + .run + .check_all(Some(&api_name))?; kill(pid, &signal)?; Ok(()) } |