diff options
| author | tv <tv@krebsco.de> | 2026-11-07 22:35:21 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-07 22:35:21 +0100 |
| commit | 046b738c74f62469f7a080415690e2dacd85e1e6 (patch) | |
| tree | d38a6903535d5fcc4f88e697cada351a25a3cf72 /src/state | |
| parent | d7a6bc3ed201ff2ca953f74f62154e5e17728f22 (diff) | |
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.
Diffstat (limited to 'src/state')
| -rw-r--r-- | src/state/host.rs | 19 |
1 files changed, 19 insertions, 0 deletions
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<T, E, F>( + &self, + user: Option<String>, + f: F, + ) -> impl Future<Output = Result<T, E>> + Send + where + F: FnOnce(&mut Transaction<'_>) -> Result<T, E> + Send + 'static, + T: Send + 'static, + E: From<StoreError> + 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 } |
