firestore.rules 547 B

12345678910111213
  1. service cloud.firestore {
  2. match /databases/{database}/documents {
  3. // Make sure the uid of the requesting user matches name of the user
  4. // document. The wildcard expression {userId} makes the userId variable
  5. // available in rules.
  6. match /users/{userId} {
  7. allow read, write, create, update, delete: if request.auth.uid != null && request.auth.uid == userId;
  8. }
  9. match /users/{userId}/{document=**} {
  10. allow read, write, create, update, delete: if request.auth.uid != null && request.auth.uid == userId;
  11. }
  12. }
  13. }