plugins-workspace icon indicating copy to clipboard operation
plugins-workspace copied to clipboard

dialog plugin should extend scope for opener.openPath

Open A-kirami opened this issue 7 months ago • 1 comments

Description When obtaining path permissions through the Dialog plugin, the path can be successfully accessed using the fs plugin. However, when attempting to use the same path with the Opener plugin's openPath function, it fails with the error:

Not allowed to open path X:\path

Expected Behavior Permissions granted through Dialog plugin should be consistently applied across all plugins (both fs and Opener) that require file system access.

Steps to Reproduce

  1. Use Dialog plugin to obtain path permissions
  2. Verify successful file operations using fs plugin
  3. Attempt to open the same path using Opener.openPath()
  4. Observe permission error

Environment

Click to view
[✔] Environment
    - OS: Windows 10.0.26100 x86_64 (X64)
    ✔ WebView2: 136.0.3240.64
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.85.0-nightly (6b6a867ae 2024-11-27)
    ✔ cargo: 1.85.0-nightly (4c39aaff6 2024-11-25)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: nightly-x86_64-pc-windows-msvc (default)
    - node: 23.5.0
    - npm: 10.9.2
    - bun: 1.2.12
    - deno: deno 2.1.4

[-] Packages
    - tauri 🦀: 2.5.1
    - tauri-build 🦀: 2.2.0
    - wry 🦀: 0.51.2
    - tao 🦀: 0.33.0
    - @tauri-apps/api : 2.5.0
    - @tauri-apps/cli : 2.5.0

[-] Plugins
    - tauri-plugin-dialog 🦀: 2.2.1
    - @tauri-apps/plugin-dialog : 2.2.1
    - tauri-plugin-fs 🦀: 2.2.1
    - @tauri-apps/plugin-fs : 2.2.1
    - tauri-plugin-opener 🦀: 2.2.6
    - @tauri-apps/plugin-opener : 2.2.6
    - tauri-plugin-persisted-scope 🦀: 2.2.1
    - @tauri-apps/plugin-persisted-scope : not installed!

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: Vue.js
    - bundler: Vite

Capabilities

Click to view
{
  "permissions": [
    "core:default",
    "dialog:default",
    "opener:default",
    "opener:allow-open-path",
    "fs:default",
    {
      "identifier": "fs:scope",
      "allow": [{ "path": "$DOCUMENT" }, { "path": "$DOCUMENT/**" }]
    }
  ]
}

A-kirami avatar May 12 '25 15:05 A-kirami

the opener and fs scopes should stay different. merging them makes no sense with how capabilities are supposed to work.

making the dialog extend the opener scope as well is something that would make sense to me though.

FabianLars avatar May 12 '25 17:05 FabianLars