Skip to main content

Crate weirdnet_collab

Crate weirdnet_collab 

Source
Expand description

Collaboration control for Weirdnet apps.

A Project holds who is in it (Member with a RoleId), signed allow and deny Rules for a person or a role, owner ConsentGrants, Invites and a signed AuditLog. Project::decide answers “may this person do this?” with an Explained decision: the answer and the chain of steps that led to it, built by running the rules themselves, so the same inputs give the same chain.

The evaluation order is fixed:

  1. Identity and membership: a banned identity or a non-member is denied, and a closed session denies everything except managing it.
  2. A rule for the person, then a rule for their role. Within one level a deny beats an allow, and expired rules are ignored (and shown in the chain).
  3. The role’s default.
  4. Extra gates the host cannot grant or waive: the audio owner’s consent (Gate::OwnerConsent), or a switch only the person’s device can check (Gate::Local).
  5. Default deny.

Permissions stop at the project: there is no narrower level. Only owner consent looks at a single stream. The crate is app-neutral: the app supplies the RoleTable (roles, their permissions, who may invite as which role, which permissions are gated); weirdnet-songnotes is one such app layer.

Every record is signed over a fixed binary layout by the person who made it, and a record from another node is checked before it is kept (accept_*). An identity is a weirdnet_contacts::UserId.

Re-exports§

pub use audit::AuditDeletion;
pub use audit::AuditEntry;
pub use audit::AuditKind;
pub use audit::AuditLog;
pub use chat::ChatError;
pub use chat::ChatItem;
pub use chat::ChatLog;
pub use chat::ChatMessage;
pub use chat::ChatPerms;
pub use decision::Decision;
pub use decision::Explained;
pub use decision::Step;
pub use handover::Handover;
pub use handover::HandoverKind;
pub use ids::Permission;
pub use ids::ProjectId;
pub use ids::RecordId;
pub use ids::RoleId;
pub use ids::StreamId;
pub use invite::Approval;
pub use invite::Invite;
pub use invite::InviteError;
pub use invite::InviteSpec;
pub use invite::InviteState;
pub use invite::JoinRequest;
pub use invite::Redeemed;
pub use project::Ctx;
pub use project::Error;
pub use project::INVITE;
pub use project::MANAGE;
pub use project::Member;
pub use project::Project;
pub use records::ConsentGrant;
pub use records::Duration;
pub use records::Effect;
pub use records::GrantStreams;
pub use records::Revocation;
pub use records::Rule;
pub use records::SignError;
pub use records::Subject;
pub use roles::Gate;
pub use roles::RoleSpec;
pub use roles::RoleTable;

Modules§

audit
The audit log: who changed which role, rule, link or consent, and when. Entries are signed by the person who acted. Each person sees the entries they are part of; the host sees all and is the only one who can delete, by a signed deletion that merges to the other nodes.
chat
A project’s text chat: signed messages, reactions and mentions, kept by the host.
decision
A decision and the reason chain behind it.
handover
Host handover: the host signs a record naming the member who becomes host. A Leave handover is given when the host leaves on purpose; a Standby one is given ahead of time to the next host, who uses it only when the host can no longer be reached. Either way the successor applies it to its own copy of the project (crate::Project::accept_handover).
ids
Names the app chooses: projects, roles, permissions, streams and records.
invite
Invites and links: who may make one, who may redeem it, and what joining needs.
project
A project: members, roles, rules, consent, invites and the audit log, and the decision.
records
Signed records: rules, consent grants and revocations.
roles
Role presets and gates, as data the app supplies.