Weave documentation
Rust referenceweave-agentfs

weave-agentfs · permissions

Source declarations, signatures and documentation for permissions.

Source: sigil/weave/local/agentfs/src/permissions.rs. SHA-256: 118efaaafca9273864ece4fbf326540cb47459233d12dbe8cd3a99ce081ea026.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

permissions::Permission

Permission types

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum Permission {
    Read,
    Write,
    Execute,
    Delete,
    Admin,
}

Source line: 12.

permissions::AgentPermission

Agent permission entry

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AgentPermission {
/// Agent identity

pub agent_identity: Identity,
/// Granted permissions

pub permissions: Vec<Permission>,
/// Path pattern (glob)

pub path_pattern: String
}

Source line: 22.

permissions::AgentPermission::new

Create new permission entry

pub fn new(
        agent_identity: Identity,
        permissions: Vec<Permission>,
        path_pattern: String,
    ) -> Self;

Source line: 35.

permissions::AgentPermission::has_permission

Check if permission is granted

pub fn has_permission(&self, permission: Permission) -> bool;

Source line: 48.

permissions::AgentPermission::matches_path

Check if path matches pattern

pub fn matches_path(&self, path: &Path) -> bool;

Source line: 53.

permissions::PermissionChecker

Permission checker for file operations

#[derive(Debug, Default)]
pub struct PermissionChecker {

}

Source line: 74.

permissions::PermissionChecker::new

Create new permission checker

pub fn new() -> Self;

Source line: 81.

permissions::PermissionChecker::add_permission

Add permission entry

pub fn add_permission(&mut self, permission: AgentPermission);

Source line: 86.

permissions::PermissionChecker::check_permission

Check if agent has permission for path

pub fn check_permission(
        &self,
        agent_identity: &Identity,
        path: &Path,
        permission: Permission,
    ) -> Result<()>;

Source line: 91.

permissions::PermissionChecker::check_ownership

Check if agent owns entry

pub fn check_ownership(&self, agent_identity: &Identity, entry: &LocalEntry) -> Result<()>;

Source line: 117.

On this page