Check if a user is a member of this organization.
(self, user_id: str | UUID)
| 284 | return next((user_org for user_org in self.users if user_org.user_id == user_id), None) |
| 285 | |
| 286 | def is_user_member(self, user_id: str | UUID) -> bool: |
| 287 | """Check if a user is a member of this organization.""" |
| 288 | # If we have the current user role set from summary queries, use that |
| 289 | if hasattr(self, '_current_user_role') and normalize_uuid(user_id) == normalize_uuid( |
| 290 | getattr(self, '_current_user_id', user_id) |
| 291 | ): |
| 292 | return True |
| 293 | return self.get_user_membership(user_id) is not None |
| 294 | |
| 295 | def is_user_admin_or_owner(self, user_id: str | UUID) -> bool: |
| 296 | """Check if a user is an admin or owner of this organization.""" |
no test coverage detected