For the sake of testing, my rules are as open as possible:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write, create: if true;
}
}
}
I make a call from Flutter to the Firebase Emulator
final bookDoc = await FirebaseFirestore.instance.collection('books').doc(bookId).get()
and I get this error:
FirebaseException ([cloud_firestore/permission-denied] The caller does not have permission to execute the specified operation.)
This happens only on the emulator. Making the same call to the Firebase server works fine.
I tried calling other documents in other collections, and verified that these documents exist.
I had a past attempt to configure AppCheck, but I removed it – from pubspec, removed the initialize function, from Android app/build.gradle. Might there be some other left over that I don’t know of?
Any other direction I should look into?
2
Answers
OK, this is embarrassing.
I had these in my emulator initialization:
So I saw functions affecting emulator logs, and rule updates appearing in emulator logs, but I mistakenly deleted:
I hope it helps someone else who makes this silly mistake.
I already changed firestore.rules in every way