Google cloud firestore 如何允许身份验证部分下具有特定用户UID的用户写入Firestore,并允许rest用户读取特定文档的数据?
我试图只允许一个用户在身份验证部分下使用特定的UID写入文档,其余用户从中读取 我还没有尝试过任何东西,因为我无法理解它背后的概念Google cloud firestore 如何允许身份验证部分下具有特定用户UID的用户写入Firestore,并允许rest用户读取特定文档的数据?,google-cloud-firestore,Google Cloud Firestore,我试图只允许一个用户在身份验证部分下使用特定的UID写入文档,其余用户从中读取 我还没有尝试过任何东西,因为我无法理解它背后的概念 service cloud.firestore { match /databases/{database}/documents { match /{document=**} { allow read, write: if request.auth.uid != null; } } } 我希望输出的是完整的Firestore规则,
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth.uid != null;
}
}
}
我希望输出的是完整的Firestore规则,我可以直接使用,并且对概念的解释将非常感谢
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read : if request.auth.uid != null;
allow write,delete : if request.aurh.uid = userId //you'll have to fetch userId from document. You can store userId in a field like 'createdBy'
}
}
}