Struct tauri_utils::acl::capability::Capability
source · pub struct Capability {
pub identifier: String,
pub description: String,
pub remote: Option<CapabilityRemote>,
pub local: bool,
pub windows: Vec<String>,
pub webviews: Vec<String>,
pub permissions: Vec<PermissionEntry>,
pub platforms: Option<Vec<Target>>,
}
Expand description
a grouping and boundary mechanism developers can use to separate windows or plugins functionality from each other at runtime.
If a window is not matching any capability then it has no access to the IPC layer at all.
This can be done to create trust groups and reduce impact of vulnerabilities in certain plugins or windows. Windows can be added to a capability by exact name or glob patterns like , admin- or main-window.
Fields§
§identifier: String
Identifier of the capability.
description: String
Description of the capability.
remote: Option<CapabilityRemote>
Configure remote URLs that can use the capability permissions.
local: bool
Whether this capability is enabled for local app URLs or not. Defaults to true
.
windows: Vec<String>
List of windows that uses this capability. Can be a glob pattern.
On multiwebview windows, prefer Self::webviews
for a fine grained access control.
webviews: Vec<String>
List of webviews that uses this capability. Can be a glob pattern.
This is only required when using on multiwebview contexts, by default
all child webviews of a window that matches Self::windows
are linked.
permissions: Vec<PermissionEntry>
List of permissions attached to this capability. Must include the plugin name as prefix in the form of ${plugin-name}:${permission-name}
.
platforms: Option<Vec<Target>>
Target platforms this capability applies. By default all platforms are affected by this capability.
Trait Implementations§
source§impl Clone for Capability
impl Clone for Capability
source§fn clone(&self) -> Capability
fn clone(&self) -> Capability
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Capability
impl Debug for Capability
source§impl<'de> Deserialize<'de> for Capability
impl<'de> Deserialize<'de> for Capability
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for Capability
impl PartialEq for Capability
source§fn eq(&self, other: &Capability) -> bool
fn eq(&self, other: &Capability) -> bool
self
and other
values to be equal, and is used
by ==
.