Skip to content
Tauri 中文网

运行时权限

运行时权限是 Tauri 核心的一部分。它在运行时持有所有权限、能力和范围,以强制执行哪个窗口可以访问哪个命令,并将范围传递给命令。

🌐 The runtime authority is part of the Tauri Core. It holds all permissions, capabilities and scopes at runtime to enforce which window can access which command and passes scopes to commands.

每当从 Webview 调用 Tauri 命令时,运行时权限会接收调用请求,确保来源被允许实际使用所请求的命令,检查该来源是否属于能力范围,并且如果为命令定义了作用域且适用,则将其注入到调用请求中,然后将请求传递给相应的 Tauri 命令。

🌐 Whenever a Tauri command is invoked from the webview the runtime authority receives the invoke request, makes sure that the origin is allowed to actually use the requested command, checks if the origin is part of capabilities and if scopes are defined for the command and applicable then they are injected into the invoke request, which is then passed to the proper Tauri command.

如果不允许源调用该命令,运行时权限将拒绝请求,并且 Tauri 命令永远不会被调用。

🌐 If the origin is not allowed to call the command, the runtime authority will deny the request and the Tauri command is never invoked.

IPC Diagram


Tauri 中文网 - 粤ICP备13048890号
Nodejs.cn 旗下网站