【发布时间】:2021-12-29 02:16:17
【问题描述】:
我正在尝试在模拟器上针对某些 firebase 安全规则运行测试,但是在运行它时,资源始终显示为 null,并且永远不会针对底层的允许写入运行测试。这是我的安全规则代码:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if isSignedIn(); // only if user is signed in are they allow to do any operation
match /{spaceId} { // Any space: not reading or writing allowed to those docs
allow read, write: if false;
}
match /{spaceId}/posts/{postId} { // any post
allow read;
allow write: if resource.user.uid == request.auth.uid;
}
}
【问题讨论】:
标签: firebase react-native google-cloud-firestore firebase-security