diff options
Diffstat (limited to 'runtime/permissions/mod.rs')
-rw-r--r-- | runtime/permissions/mod.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/runtime/permissions/mod.rs b/runtime/permissions/mod.rs index 035c39304..5edfbe8f7 100644 --- a/runtime/permissions/mod.rs +++ b/runtime/permissions/mod.rs @@ -1915,6 +1915,41 @@ impl deno_websocket::WebSocketPermissions for PermissionsContainer { } } +impl crate::ops::fs::FsPermissions for PermissionsContainer { + fn check_read( + &mut self, + path: &Path, + api_name: &str, + ) -> Result<(), AnyError> { + self.0.lock().read.check(path, Some(api_name)) + } + + fn check_read_blind( + &mut self, + path: &Path, + display: &str, + api_name: &str, + ) -> Result<(), AnyError> { + self.0.lock().read.check_blind(path, display, api_name) + } + + fn check_write( + &mut self, + path: &Path, + api_name: &str, + ) -> Result<(), AnyError> { + self.0.lock().write.check(path, Some(api_name)) + } + + fn check_read_all(&mut self, api_name: &str) -> Result<(), AnyError> { + self.0.lock().read.check_all(Some(api_name)) + } + + fn check_write_all(&mut self, api_name: &str) -> Result<(), AnyError> { + self.0.lock().write.check_all(Some(api_name)) + } +} + // NOTE(bartlomieju): for now, NAPI uses `--allow-ffi` flag, but that might // change in the future. impl deno_napi::NapiPermissions for PermissionsContainer { |