Skip to content
Advertisement

FirebaseError: Missing or insufficient permissions. with getDocs()

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;
    }
    ```

Advertisement

Answer

You can change to:

 ...
 allow read: if true;
 allow update: if true;
 ...
Advertisement