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

Method remove_edge

nodedb/src/control/security/permission_tree/cache.rs:87–99  ·  view source on GitHub ↗

Remove a parent→child edge from the hierarchy.

(&mut self, tenant_id: u64, child_id: &str)

Source from the content-addressed store, hash-verified

85
86 /// Remove a parent→child edge from the hierarchy.
87 pub fn remove_edge(&mut self, tenant_id: u64, child_id: &str) {
88 let Some(tenant) = self.tenants.get_mut(&tenant_id) else {
89 return;
90 };
91 if let Some(old_parent) = tenant.parent_map.remove(child_id)
92 && let Some(children) = tenant.children_map.get_mut(&old_parent)
93 {
94 children.remove(child_id);
95 if children.is_empty() {
96 tenant.children_map.remove(&old_parent);
97 }
98 }
99 }
100
101 /// Load a permission grant into the cache.
102 pub fn put_grant(&mut self, tenant_id: u64, grant: &PermissionGrant) {

Callers 6

on_edge_upsertFunction · 0.45
on_edge_deleteFunction · 0.45
remove_edgeFunction · 0.45
execute_edge_deleteMethod · 0.45
apply_undo_edgeMethod · 0.45

Calls 3

get_mutMethod · 0.45
removeMethod · 0.45
is_emptyMethod · 0.45

Tested by 1

remove_edgeFunction · 0.36