firestore.rules 489 B

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