Test
Merged
SW
4mo ago+83+83+01234567890123456789-14-14-01234567890123456789
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
checkIsAdminapplies to all endpoints usingvalidateChatAccess(read and write). - No account override params; access is resolved from
roomId, and admin access returns the room’s owneraccountId. - Tests added for admin access and to ensure the owner path skips the admin check; updated test mocks for the new dependency.
- Admin bypass via
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.