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)
| 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) { |
no test coverage detected