I am new to firestore rules and I encountered a glaring problem.
My rules look like this:
If I uncomment either or both the sections, and comment the part with (document=**), all project calls to the firestore realtime database will fail because of permissions. I cannot figure out why. In all documentation this is the preferred way. Is it case sensitive? I know it is not the auth part that fails, because if I leave the rules like in the image, all project calls work.
For clarity, this is what the database structure looks like (yes, Projects has a capital P):
CodePudding user response:
Are Firestore rules case sensitive?
Yes, the collection/document IDs are case sensitive.
match /{document=**} {
allow read, write: if request.auth != null;
}
The above rule allows any user logged in with Firebase authentication to read and write to any collection in the database. If you still get permission errors, check if the user is logged in or no.