docs/generated/contracts.mdgenerated from code

Reference · 2 min read

access

Contracts: access.

Source: crates/lvcs-doc/src/kinds/caps/access.rs.

ruston main
1/// Who acts: the key, and, for a signed change, the grant its record2/// cites (`None`: any grant of the key's that covers the op).3#[derive(Debug, Clone, Copy, PartialEq, Eq)]4pub struct Actor<'a> {5    pub key: &'a PeerKey,6    pub cites: Option<&'a GrantId>,7}89/// How the actor reached this node, which narrows the grants it acts10/// under (discussion:owner/626).11#[derive(Debug, Clone, Copy, PartialEq, Eq)]12pub enum Connection<'a> {13    /// The per-user socket: the daemon's own user, acting as a key the14    /// project holds (discussion:owner/272). It reads with the node's15    /// permissions; every other op needs the key's own grants.16    Local,17    /// A paired device whose device grant `principal` signed: its device18    /// grants only, each holding only as far as `principal`'s own grants19    /// reach (discussion:owner/526 and discussion:owner/527).20    Device { principal: &'a PeerKey },21    /// A reader with no key: `read` grants to anyone (`ANYONE`), on a22    /// project file or on a ledger the policy in force makes public23    /// (`public`, its `[public] ledgers`; discussion:owner/382 and24    /// discussion:owner/567).25    Anonymous { public: &'a [String] },26    /// Another node of the project, by its signer key: a `read` or27    /// `write` grant covering the document lets it sync it.28    Node,29    /// The instance of plugin `name` (discussion:owner/553): its key's own30    /// grants, while it is a member of the plugin.31    Plugin { name: &'a str },32    /// A signed change, received or about to be signed: the grant its33    /// record cites (`Actor::cites`), and nothing else.34    Change,35}3637/// What [`authorize`] refused, and the rule a refusal names.38#[derive(Debug, Clone, Copy, PartialEq, Eq)]39pub struct Deny {40    pub rule: Rule,41    pub denial: Denial,42}