我正在尝试使用Fi还原仿真器测试我的安全规则。我制定了一个禁止所有读写的firestore.rules安全规则:
service cloud.firestore {
match /databases/{database}/documents {
allow read, write: if false;
}
}
我从终端启动了Firestore仿真器:
firebase emulators:start --only firestore
然后我初始化了Firestore客户端:
import firebase_admin
from firebase_admin im
我不明白为什么这个修复安全规则在web上失败。
我使用的是@角/火的最新版本,它包含一个集合上的查询,还有一个最新的firebase,但是它在模拟中工作。
service cloud.firestore {
match /databases/{database}/documents {
// Match any document in the 'cities' collection
match /events/{event} {
allow read: if (resource.data.access.code == 'public
我试图在我的NativeScript应用程序中使用FireStore。FireBase初始化已圆满完成。现在,我想访问我的集合,其中有一个文档。在我的.Vue组件标记中,我编写了以下内容:
import {firestore} from "@nativescript/firebase"
mounted() {
//fetch data from the firestore
firestore.collection('Husqvarnas').get()
.then(snapshot => {
snapshot.forEach((doc) =>
我目前正在尝试让用户通过匿名身份验证来实现对Firestore数据库的读访问。 我想这么做的原因是因为我一直收到电子邮件说“您的Cloud Firestore数据库有不安全的规则”,而我不想让用户登录。 为了解决这个问题,当应用程序打开时,我让每个人都成为匿名用户,但是我在编写允许匿名用户读取访问权限的规则时遇到了问题。 下面的函数正在运行: func signInUser(){
let auth = Auth.auth()
auth.signInAnonymously{(result, err) in
if let err = err{
我是Firebase的新手,正在尝试理解数据库规则。我正在使用Firestore。
我有一个数据库,基本上需要被所有用户读取,也需要写入。所有用户都可以看到数据库中的文档,并通过某些操作更改某些字段。在某些情况下,他们会删除某些过期的旧文件。
现在,我明白我不能对所有人开放读写,因为这是不安全的。所以我使用身份验证,我将匿名地对用户进行身份验证,这样只有经过身份验证的用户才能访问。
我知道这就是我的工作:
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {