MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / is_audit_protected

Method is_audit_protected

nodedb/src/control/security/ceiling.rs:103–109  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 2

readMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected