0

I have these database security rules:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read: true;
      allow write: if false;
    }
  }
}

all of our DB data is public by design, so we allow everyone to read it. my question is how can I disable the error emails I keep getting from firebase?

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Or Bachar
  • 1,451
  • 3
  • 15
  • 20
  • Depends on what tour database contains. Let’s say you had user details you could only Allow the users to write if their is matches the documents I’d – GILO Apr 16 '20 at 10:57
  • @GILO thanks for the comment, I edited the title, I meant that any user can READ the entire db, which is fine – Or Bachar Apr 16 '20 at 12:04

2 Answers2

2

Instead of match /{document=**} {... just create a simple rule for every collection:

match /users/{document} {
  allow read: if true;
}
Dakine
  • 198
  • 7
0

If the other answers don't help, are you using anonymous login? There are a few articles for iOS, Web, Android, etc... That show you how to do that.

Here is an example:

firebase.auth().signInAnonymously().catch(function(error) {
  // Handle Errors here.
  var errorCode = error.code;
  var errorMessage = error.message;
  // ...
});

Keep in mind however that you may have to delete those users once in a while. For example, there is a discussion here on how to maintain this.

Alexis
  • 26
  • 5