aboutsummaryrefslogtreecommitdiffstats
path: root/src/document/store.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-07 22:35:09 +0100
committertv <tv@krebsco.de>2026-11-07 22:35:09 +0100
commit7dbb95d6c1dd7245e50d3aaadd26ee24f3506ba1 (patch)
tree2fca159bf54cc1f5483a00b5dea072c9b8b68908 /src/document/store.rs
parent42f67c3c35c90011d215744bf9a42123d6650e17 (diff)
access: the user registry
_continuum/users/<name>: one entry per user, with capabilities by path (read, write) granted by whom and when, and a disabled flag. Read leniently: a damaged entry gives less, never more. Protocol data stays apart: a capability outside _continuum never covers it. Auth plan M1.
Diffstat (limited to 'src/document/store.rs')
-rw-r--r--src/document/store.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/document/store.rs b/src/document/store.rs
index f18f2fa..db5ecbc 100644
--- a/src/document/store.rs
+++ b/src/document/store.rs
@@ -650,6 +650,11 @@ fn summary(
Ok(JsonValue::Object(out))
}
+/// Whether `path` holds a map (one, or concurrent ones merged).
+pub(crate) fn is_map(doc: &impl ReadDoc, path: &[String]) -> bool {
+ matches!(resolve_through(doc, path), Ok(Some(Resolved::Maps(_))))
+}
+
/// Keys of the merged map at `path`; empty if it doesn't exist or isn't a map.
pub(crate) fn keys_at(doc: &impl ReadDoc, path: &[String]) -> Result<Vec<String>, StoreError> {
Ok(match resolve_through(doc, path)? {