如何设置云Firestore数据库以符合以下规则?

问题描述 投票:0回答:1

我在云端防火墙模拟器中测试时遇到问题。当我有以下规则时,我无法获得“写入”访问权限。

我的收藏品应该是“用户”吗?我的文件是否以某人的用户ID firebase创建?

我的数据库应该如何获得正确的结果?

service cloud.firestore {
  match /databases/{database}/documents {
    match /users/{userId} {
      allow read, update, delete: if request.auth.uid == userId;
      allow create: if request.auth.uid != null;
    }
  }
}
firebase google-cloud-firestore firebase-security
1个回答
0
投票

我认为Cloud Firestore安全规则是正确的。

  • 您是否使用Firebase身份验证登录?
  • 您是否部署了Cloud Firestore安全规则?

如果不起作用,那么您应该测试您的Cloud Firestore安全规则。

看到:

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.