diff options
Diffstat (limited to 'src/state/mod.rs')
| -rw-r--r-- | src/state/mod.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/state/mod.rs b/src/state/mod.rs index ed93fda..441cdaf 100644 --- a/src/state/mod.rs +++ b/src/state/mod.rs @@ -250,7 +250,11 @@ fn judged_here( replica: &crate::document::replica::Replica, before: &[crate::document::ChangeHash], ) -> Result<(), String> { - if !crate::access::policy::of(&replica.doc).enforced() { + // By the policy it was written under, as receivers judge it: one removing or + // changing the policy is judged too. + let enforced = crate::document::at::At::new(&replica.doc, before) + .is_some_and(|at| crate::access::policy::of(&at).enforced()); + if !enforced { return Ok(()); } let after = replica.doc.get_heads(); |
