Test

Merged
SW
4mo ago
+83-14

Summary by cubic

Allow Recoup admins to access any chat across accounts by ID. validateChatAccess now grants access to the room owner first, and only checks checkIsAdmin if ownership fails, keeping the common path fast.

  • New Features
    • Admin bypass via checkIsAdmin applies to all endpoints using validateChatAccess (read and write).
    • No account override params; access is resolved from roomId, and admin access returns the room’s owner accountId.
    • Tests added for admin access and to ensure the owner path skips the admin check; updated test mocks for the new dependency.

Summary by CodeRabbit

  • Bug Fixes
    • Improved chat access handling so room owners continue to have access, and admins can now open chats they don’t own.
    • Standardized denied-access responses with a consistent “Access denied to this chat” message.
    • Simplified access checks to reduce unexpected denial cases when ownership data is unavailable.