I tried reading the first couple of answers but none seem to have the same rule with the one I currently have my hands on.
When I try to call the getDocs() function (using react)
let userInfo = await getDoc(doc(db, chargerInfo.userRef));
I seem to be getting the error FirebaseError: Missing or insufficient permissions.
what can I do to not get this error? Below is the rule that I have
match /devices/{id} {
allow read: if request.auth != null;
allow update: if request.auth != null;
}
```
2
Answers
You can change to:
In your app inside cloud firestore, go to rules and replace ‘allow read and write…etc." sentence with the following line:
allow read, write: if request.time > timestamp.date(2020, 9, 10);