rules 2
rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { // Allow users to read/write their own data match /users/{userId} { allow read, write: if request.auth != null && request.auth.uid == userId; allow create: if request.auth == null; } // Allow reading users for referral checks match /users/{userId} { allow read: if true; } // Referrals collection match /referrals/{referralId} { allow read, write: if request.auth != null; allow create: if true; } // Withdrawal requests match /withdrawalRequests/{requestId} { allow read, write: if request.auth != null; } } }