skip to Main Content

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


  1. You can change to:

     ...
     allow read: if true;
     allow update: if true;
     ...
    
    Login or Signup to reply.
  2. 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);

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search