Reputation: 23
I want my application read only the language collection data from firebase before authentication only and read data from Users collection only when user is authenticated.
Upvotes: 0
Views: 98
Reputation: 598740
As far as I can see, you're asking for:
service cloud.firestore {
match /databases/{database}/documents {
match /Language/{document} {
allow read: if true;
}
match /Users/{document} {
allow read: if request.auth != null;
}
}
}
With the above any user (regardless of their authentication state) can read the Language
collection, but only authenticated users can read the Users
collection.
Upvotes: 1