- Serverless Web Applications with React and Firebase
- Harmeet Singh Mayur Tanna
- 91字
- 2021-08-27 19:11:10
Security rules
Before creating a database and collection in Cloud Firestore, it prompts you to apply the security rules for our database.
Take a look at the following screenshot:

Here are some code example of Firestore rules:
Public:
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write;
}
}
}
Users:
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read, write: if request.auth.uid == userId;
}
}
}
Private:
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if false;
}
}
}
推薦閱讀
- 兩周自制腳本語言
- Apache Spark 2 for Beginners
- Java Web基礎與實例教程
- 正則表達式經典實例(第2版)
- Scala Reactive Programming
- 運維前線:一線運維專家的運維方法、技巧與實踐
- Solutions Architect's Handbook
- 從Excel到Python數據分析:Pandas、xlwings、openpyxl、Matplotlib的交互與應用
- 區塊鏈架構之美:從比特幣、以太坊、超級賬本看區塊鏈架構設計
- C編程技巧:117個問題解決方案示例
- Learning Nessus for Penetration Testing
- Building Business Websites with Squarespace 7(Second Edition)
- iOS Development with Xamarin Cookbook
- 用Go語言自制編譯器
- 新手學ASP.NET 3.5網絡開發