Skip to content

Instantly share code, notes, and snippets.

@muthuishere
Created July 17, 2021 07:56
Show Gist options
  • Save muthuishere/a5d3776d9f23eac4172624b85a2980d7 to your computer and use it in GitHub Desktop.
Save muthuishere/a5d3776d9f23eac4172624b85a2980d7 to your computer and use it in GitHub Desktop.
Firestore Tweaks
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId}/{document=**} {
allow create: if request.auth != null;
allow read, update, delete: if request.auth.uid == userId;
}
}
}
@muthuishere
Copy link
Author

The above script will restrict user to allow only data to belong to them in firestore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment