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

Method install_replicated_role

nodedb/src/control/security/role.rs:101–114  ·  view source on GitHub ↗

Install a replicated `StoredRole` into the in-memory cache. Never touches the catalog — the applier handles redb separately via `SystemCatalog::put_role`. Upsert semantics.

(&self, stored: &StoredRole)

Source from the content-addressed store, hash-verified

99 /// Never touches the catalog — the applier handles redb
100 /// separately via `SystemCatalog::put_role`. Upsert semantics.
101 pub fn install_replicated_role(&self, stored: &StoredRole) {
102 let custom = CustomRole {
103 name: stored.name.clone(),
104 tenant_id: TenantId::new(stored.tenant_id),
105 parent: if stored.parent.is_empty() {
106 None
107 } else {
108 Some(stored.parent.clone())
109 },
110 created_at: stored.created_at,
111 };
112 let mut roles = self.roles.write().unwrap_or_else(|p| p.into_inner());
113 roles.insert(stored.name.clone(), custom);
114 }
115
116 /// Remove a replicated role from the in-memory cache.
117 pub fn install_replicated_drop_role(&self, name: &str) {

Callers 4

putFunction · 0.80
create_roleFunction · 0.80
alter_roleFunction · 0.80
set_role_parentFunction · 0.80

Calls 4

cloneMethod · 0.45
is_emptyMethod · 0.45
writeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected