Google cloud firestore Flamelink CMS和云Firestore自定义安全规则

Google cloud firestore Flamelink CMS和云Firestore自定义安全规则,google-cloud-firestore,firebase-security,flamelink-cms,Google Cloud Firestore,Firebase Security,Flamelink Cms,我使用的是建立在云Firestore数据库之上的Flamelink CMS。我很难理解如何从他们的作品中提取任何东西。我基本上只想将属于我的模式之一的内容设置为始终可读,而不管用户是否经过身份验证 在RTDB中,这很容易做到,就像这样(这里category1总是可读的,即使应用程序的其余部分需要身份验证) 但在CloudFireStore中,内容存储在一个平面结构中,我不知道如何实现同样的效果。我尝试了类似的方法,但没有成功(category1只是一个例子,实际上它得到了一个自动生成的id) {

我使用的是建立在云Firestore数据库之上的Flamelink CMS。我很难理解如何从他们的作品中提取任何东西。我基本上只想将属于我的模式之一的内容设置为始终可读,而不管用户是否经过身份验证

在RTDB中,这很容易做到,就像这样(这里category1总是可读的,即使应用程序的其余部分需要身份验证)

但在CloudFireStore中,内容存储在一个平面结构中,我不知道如何实现同样的效果。我尝试了类似的方法,但没有成功(category1只是一个例子,实际上它得到了一个自动生成的id)

{
  "rules": {
    "flamelink": {
      ".read": "auth != null",
      ".write": "auth != null",
      "users": {
        ".indexOn": ["id", "email"]
      },
      "environments": {
        "production": {
          "content": {
            "category1": {
              ".read": true,
              "en-US": {
                ".indexOn": "name"
              }
            },
            "category2": {
              "en-US": {
                ".indexOn": "name"
              }
            }
          }
        }
      }
    }
  }
}
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if request.auth.uid != null;
    }
    match /fl_schemas/category1 {
      allow read;
    }
  }
}