Find the role metadata entry that belongs to a given user.
(user_id: str)
| 222 | |
| 223 | |
| 224 | def get_role_meta_for_user(user_id: str) -> Optional[Dict[str, Any]]: |
| 225 | """Find the role metadata entry that belongs to a given user.""" |
| 226 | roles_meta = load_roles_meta() |
| 227 | for role_name, role_info in roles_meta.get("roles", {}).items(): |
| 228 | if role_info.get("user_id") == user_id: |
| 229 | role_copy = dict(role_info) |
| 230 | role_copy["role_name"] = role_name |
| 231 | return role_copy |
| 232 | return None |
| 233 | |
| 234 | |
| 235 | def resolve_role_chat_id(user_id: str, profile: Optional[Dict[str, Any]] = None) -> Optional[str]: |
no test coverage detected