Answers for "Uncaught (in promise) FirebaseError: Missing or insufficient permissions."

8

Uncaught (in promise) FirebaseError: Missing or insufficient permissions.

When you look at your Firestore rules, they should match:

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read;
      allow write: if false;
    }
  }
}
If you do not allow read, you may see this issue in the client.
Posted by: Guest on January-23-2021
2

Uncaught Error in onSnapshot: FirebaseError: Missing or insufficient permissions.

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read;
      allow write: if false;
    }
  }
}
Posted by: Guest on June-19-2020
2

firestore missing or insufficient permissions

//"firestore missing or insufficient permissions" could be because of 
//insufficient read and/or write permissions

//Let's say that a user is not logged in but needs to read landmarks data,
//we should then create a rule to allow the read operation
service cloud.firestore {
  match /databases/{database}/documents {
    // Explicitly allow users to read the collection
    // even if they are not authenticated
    match /landmarks/{landmark} {
    allow read;
    }

    match /cities/{city} {
      allow read, write: if <condition>;
    }
  }
}
//More info on structuring security rules:
//https://firebase.google.com/docs/firestore/security/rules-structure
Posted by: Guest on July-07-2020

Code answers related to "Uncaught (in promise) FirebaseError: Missing or insufficient permissions."

Browse Popular Code Answers by Language