pub struct PermissionSet { /* private fields */ }Expand description
The set of entity-write permissions a plugin holds, distilled from its
manifest homecore_permissions at load time.
Implementations§
Source§impl PermissionSet
impl PermissionSet
Sourcepub fn from_manifest(manifest: &PluginManifest) -> Self
pub fn from_manifest(manifest: &PluginManifest) -> Self
Build a permission set from a manifest’s homecore_permissions.
Only state:write authority is modelled here (the host import this
gates is hc_state_set). A bare glob ("light.*") is treated as a
write grant; the explicit "state:write:<glob>" form is also
accepted. Other capability strings (state:read:*, future verbs)
are ignored for write-gating purposes.
Sourcepub fn allow_all() -> Self
pub fn allow_all() -> Self
An all-allowing set (equivalent to a "*" grant). Used by the
legacy permission-free WasmtimeRuntime::load_wasm path so existing
callers/tests that do not supply a manifest keep working; the
permission-gated path uses Self::from_manifest.
Sourcepub fn may_write(&self, entity_id: &str) -> bool
pub fn may_write(&self, entity_id: &str) -> bool
May this plugin write the given entity id (e.g. "light.kitchen")?
Sourcepub fn write_grant_count(&self) -> usize
pub fn write_grant_count(&self) -> usize
Number of write-grant globs (0 = can write nothing).
Trait Implementations§
Source§impl Clone for PermissionSet
impl Clone for PermissionSet
Source§fn clone(&self) -> PermissionSet
fn clone(&self) -> PermissionSet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more