weirdnet-collab 0.3.0

Collaboration control for Weirdnet apps: project members and roles, signed allow and deny rules, owner consent grants, a decision with a reason chain, invites and a signed, mergeable audit log. App-agnostic: the app defines what a project, role and permission are.
Documentation
# weirdnet-collab

[![crates.io](https://img.shields.io/crates/v/weirdnet-collab.svg)](https://crates.io/crates/weirdnet-collab)
[![docs.rs](https://docs.rs/weirdnet-collab/badge.svg)](https://docs.rs/weirdnet-collab)

Collaboration control for Weirdnet apps: project members and roles, signed allow and deny rules, owner consent grants, a decision with a reason chain, invites and a signed, mergeable audit log. App-agnostic: the app defines what a project, role and permission are.

Part of [Weirdnet](https://net.weirdbrains.com) by [Weird Brains](https://weirdbrains.com). BSD-3-Clause.

## What it does

- **Roles and a permission catalog** you define (`RoleTable`): presets, a host role, a default role for new invitees, and gates (a permission that also needs the audio owner's consent, or a local switch).
- **Signed rules**: allow or deny a permission for one member or a whole role, optionally until a time. A member rule beats a role rule, a deny beats an allow at the same level, expired rules are ignored.
- **Consent grants** signed by the owner of the audio: once or always, for all of their streams or named ones, revocable. Nobody else, the host included, can grant them.
- **A decision with a reason chain**: `Project::decide` returns `Allowed`, `Denied` or `NeedsConsent`, and the list of steps that led there, the same for the same inputs.
- **Invites**: links with a role, an expiry, a use limit and optional host approval; direct invites for one person; revocation that can end the sessions that came through the link.
- **A signed, mergeable audit log**: each person sees the entries they are part of; only a host can delete entries (a signed deletion); two copies merge without repeats and refuse tampered entries.

Everything is plain data (serde) and is evaluated with no I/O, so any node can re-run the rules and get the same answer. Identities are `weirdnet-contacts` user ids (the transport peer id).

```sh
cargo run --example basic
```

The evaluation order is in the crate docs: identity and membership, member rule, role rule, role default, extra gates, default deny.