0
votes

I am having trouble testing in the cloud firestore simulator. I cant get "write" access when I have the following rules.

Should my collection be "users" and my documenent under that be named with someones userid firebase creates?

What should my database look like to get the correct results?

service cloud.firestore {
  match /databases/{database}/documents {
    match /users/{userId} {
      allow read, update, delete: if request.auth.uid == userId;
      allow create: if request.auth.uid != null;
    }
  }
}
1

1 Answers

0
votes

I think that Cloud Firestore Security Rules is correct.

  • Did you log in using Firebase Authentication?
  • Did you deploy your Cloud Firestore Security Rules?

If does not work then you should test your Cloud Firestore Security Rules.

See: