Check if an audit entry is protected by the minimum retention ceiling. Returns `true` if the entry CANNOT be deleted.
(&self, tenant_id: u64, entry_age_days: u32)
| 101 | /// Check if an audit entry is protected by the minimum retention ceiling. |
| 102 | /// Returns `true` if the entry CANNOT be deleted. |
| 103 | pub fn is_audit_protected(&self, tenant_id: u64, entry_age_days: u32) -> bool { |
| 104 | let ceilings = self.ceilings.read().unwrap_or_else(|p| p.into_inner()); |
| 105 | if let Some(c) = ceilings.get(&tenant_id) { |
| 106 | return entry_age_days < c.audit_min_retention_days; |
| 107 | } |
| 108 | false |
| 109 | } |
| 110 | |
| 111 | /// Always returns true — audit log deletion is categorically forbidden. |
| 112 | /// This is a ceiling enforcement: even superuser cannot DELETE/TRUNCATE audit. |