muneikh
muneikh

Reputation: 2107

Firebase simulate read denied

In my firebase project, I have implemented Google Authentication.

My firebase rules looks like the following:

{
  "rules": {
      "users": {
      "$uid": {
        ".read": "auth.uid == $uid",
        ".write": "auth.uid == $uid"
      }
    }
  }
}

The database has the following snapshot: enter image description here

Everytime I try to simulate. Firebase says that the "Simulate read denied".

enter image description here

Any ideas that I am doing wrong here?

Upvotes: 3

Views: 3810

Answers (2)

Darwin Biler
Darwin Biler

Reputation: 1

I've also encountered this in FireStore and when simulating a CREATE. It turns out you also need to specify the ID when POSTing to the collection

a sample simulation

Upvotes: 0

muneikh
muneikh

Reputation: 2107

I realised the problem. I was accessing "/users" but instead, I should be accessing "/users/$uid" to simulate rule.

Upvotes: 7

Related Questions