//! Banned nodes (`_continuum/banned/`, `{"by", "at", "reason"}`), written by a //! user who may write there, as any protocol data: a node refuses a banned node's //! handshake, so it neither syncs with it nor counts it a member (`swarm::peer`), and //! with the swarm's policy every node refuses the changes a banned node commits //! (`access::rules`, judged as the ban stood when they were made). Deleting the entry //! lifts the ban. use crate::document::{ReadDoc, meta, store}; /// Where `node`'s ban is. pub(crate) fn path(node: &str) -> Vec { meta::path(&[meta::BANNED, node]) } /// Whether `doc` bans `node`. pub(crate) fn banned(doc: &impl ReadDoc, node: &str) -> bool { store::read_path(doc, &path(node)).ok().flatten().is_some() }