如何解决Flamelink CMS和Cloud Firestore自定义安全规则
我正在使用在Cloud Firestore数据库之上构建的Flamelink CMS。我很难理解如何从他们的examples of security rules中提取任何东西。我基本上只是想将属于我的一种模式的内容设置为始终可读,无论用户是否通过身份验证。
在RTDB中,这非常容易做到(即使应用程序的其余部分需要身份验证,此处category1仍然可读)。
{
"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"
}
}
}
}
}
}
}
}
但是在Cloud Firestore中,内容存储在平面结构中,我不知道该如何实现。我尝试了类似的尝试,但没有成功(category1只是一个例子,实际上它会获得一个自动生成的ID)。
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;
}
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。