mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
refactor: clean up permission handling (#9367)
This commit is contained in:
parent
b3fe85163f
commit
0e70d9e59b
20 changed files with 969 additions and 894 deletions
|
@ -88,7 +88,7 @@ fn op_run(
|
|||
_zero_copy: &mut [ZeroCopyBuf],
|
||||
) -> Result<Value, AnyError> {
|
||||
let run_args: RunArgs = serde_json::from_value(args)?;
|
||||
state.borrow::<Permissions>().check_run()?;
|
||||
state.borrow::<Permissions>().run.check()?;
|
||||
|
||||
let args = run_args.cmd;
|
||||
let env = run_args.env;
|
||||
|
@ -193,7 +193,7 @@ async fn op_run_status(
|
|||
|
||||
{
|
||||
let s = state.borrow();
|
||||
s.borrow::<Permissions>().check_run()?;
|
||||
s.borrow::<Permissions>().run.check()?;
|
||||
}
|
||||
|
||||
let resource = state
|
||||
|
@ -285,7 +285,7 @@ fn op_kill(
|
|||
_zero_copy: &mut [ZeroCopyBuf],
|
||||
) -> Result<Value, AnyError> {
|
||||
super::check_unstable(state, "Deno.kill");
|
||||
state.borrow::<Permissions>().check_run()?;
|
||||
state.borrow::<Permissions>().run.check()?;
|
||||
|
||||
let args: KillArgs = serde_json::from_value(args)?;
|
||||
kill(args.pid, args.signo)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue