Look up a custom role by name. Returns None if not found.
(&self, name: &str)
| 312 | |
| 313 | /// Look up a custom role by name. Returns None if not found. |
| 314 | pub fn get_role(&self, name: &str) -> Option<CustomRole> { |
| 315 | let roles = self.roles.read().ok()?; |
| 316 | roles.get(name).cloned() |
| 317 | } |
| 318 | |
| 319 | /// List all custom roles. |
| 320 | pub fn list_roles(&self) -> Vec<CustomRole> { |