基本Cloud Firestore安全规则设置

时间:2020-01-31 17:09:47

标签: google-cloud-firestore firebase-security

我当前正在使用此默认代码来保护我的Cloud Firestore数据库:

service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read, write: if request.auth.uid != null;
    }
  }
}

此代码可以正常工作,并且模拟也可以。

我尝试更新代码并使用在每本指南中找到的新默认代码:

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if request.auth.uid != null;
    }
  }
}

但是此代码每次都会失败,不会授予访问权限。

在模拟中,我只是尝试读取Collection中名为“参数”的文档。

我在这里想念什么吗?我的计划是事后加强安全性访问。

1 个答案:

答案 0 :(得分:0)

好的,我实际上意识到数据库访问规则和存储访问规则具有各自独立的安全面板。

我正在尝试使用默认数据库规则更新存储规则...

相关问题