Check that adopting `parent` as `role_name`'s inheritance parent would not create a cycle or exceed [`MAX_ROLE_INHERITANCE_DEPTH`]. Used by `ALTER ROLE ... SET INHERIT` and the role-to-role form of `GRANT` so that re-parenting an existing role enforces the same chain invariant `create_role` enforces at creation. The parent's existence is the caller's responsibility.
(&self, role_name: &str, parent: &str)
| 304 | /// chain invariant `create_role` enforces at creation. The parent's |
| 305 | /// existence is the caller's responsibility. |
| 306 | pub fn check_inheritance_cycle(&self, role_name: &str, parent: &str) -> crate::Result<()> { |
| 307 | let roles = self.roles.read().map_err(|e| crate::Error::Internal { |
| 308 | detail: format!("role store lock poisoned: {e}"), |
| 309 | })?; |
| 310 | check_inheritance_chain(role_name, parent, &roles) |
| 311 | } |
| 312 | |
| 313 | /// Look up a custom role by name. Returns None if not found. |
| 314 | pub fn get_role(&self, name: &str) -> Option<CustomRole> { |
no test coverage detected