From 4cda8cadb7ada0b0c5c59ec99459671b006b3799 Mon Sep 17 00:00:00 2001 From: yiqi-017 <22300246009@m.fudan.edu.cn> Date: Sun, 5 Jul 2026 22:55:10 +0800 Subject: [PATCH] fix(desktop): allow pick_directory command in ACL The import-memory button failed with "Command pick_directory not allowed by ACL" because Tauri v2 requires custom commands to be granted in the capability. Add allow-pick-directory permission and grant it. --- frontends/desktop/src-tauri/capabilities/default.json | 1 + frontends/desktop/src-tauri/permissions/bridge-commands.toml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/frontends/desktop/src-tauri/capabilities/default.json b/frontends/desktop/src-tauri/capabilities/default.json index cf96e341..3bdf54bb 100644 --- a/frontends/desktop/src-tauri/capabilities/default.json +++ b/frontends/desktop/src-tauri/capabilities/default.json @@ -18,6 +18,7 @@ "allow-start-bridge-with-config", "allow-get-config", "allow-export-mykey", + "allow-pick-directory", "allow-shortcut-should-ask", "allow-shortcut-decide" ] diff --git a/frontends/desktop/src-tauri/permissions/bridge-commands.toml b/frontends/desktop/src-tauri/permissions/bridge-commands.toml index cf78df39..54d37c7b 100644 --- a/frontends/desktop/src-tauri/permissions/bridge-commands.toml +++ b/frontends/desktop/src-tauri/permissions/bridge-commands.toml @@ -18,6 +18,11 @@ identifier = "allow-export-mykey" description = "Save mykey.py via native file dialog." commands.allow = ["export_mykey"] +[[permission]] +identifier = "allow-pick-directory" +description = "Pick a source directory via native folder dialog (import memory)." +commands.allow = ["pick_directory"] + [[permission]] identifier = "allow-shortcut-should-ask" description = "Check whether to show the first-run desktop-shortcut prompt."