From 046b738c74f62469f7a080415690e2dacd85e1e6 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 7 Nov 2026 22:35:21 +0100 Subject: remake: forgetting and releasing name their user Forget records and released quarantines name the user who made them, so they are judged by its capabilities. Auth plan M6. --- src/state/host.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/state') diff --git a/src/state/host.rs b/src/state/host.rs index 47fd946..a48a6fb 100644 --- a/src/state/host.rs +++ b/src/state/host.rs @@ -246,6 +246,25 @@ impl Host for AppState { async move { state.mutate_doc(f).await } } + fn commit_doc_for( + &self, + user: Option, + f: F, + ) -> impl Future> + Send + where + F: FnOnce(&mut Transaction<'_>) -> Result + Send + 'static, + T: Send + 'static, + E: From + Send + 'static, + { + let state = self.clone(); + async move { + state + .mutate_doc_for(user, crate::document::signatures::Sign::Protocol, f) + .await + .map(|(out, _)| out) + } + } + fn superseded(&self) -> crate::remake::Superseded { self.superseded_writes } -- cgit v1.3.1