Skip to content

w3bdesign/firestore-ecommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Security rules example for Firestore

See firestore.rules also.


The following rules will provide a great starting point for Firebase apps centered around the addition of new data.

These rules will only allow the creation of new data.

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read: if request.auth != null;
      allow create: if request.auth != null;
      allow update: if request.auth != null && !resource.data.exists();
    }
  }
}

These rules will prevent deletion or updating of data. Of course, this isn't suitable for all apps.

But if you're just exploring new concepts, this is a great way to ensure data isn't tampered with among users.

About

Security rules example for Firestore

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published