gpt4 book ai didi

firebase - Firestore 规则不断变化

转载 作者:行者123 更新时间:2023-12-02 02:30:12 24 4
gpt4 key购买 nike

我正在为我的项目使用 Firestore 并更新了我的规则:

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

}
}
}

然而,只要 firestore 发生变化,它就会变成这样:

rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if
request.time < timestamp.date(2020, 11, 26);
}
}
}

我在几天内多次重置它,但它一直在变回来,我做错了什么?

编辑

这是我的 package.json,它看起来没有任何对规则文件的引用。

{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"lint": "eslint .",
"serve": "firebase emulators:start --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "12"
},
"main": "index.js",
"dependencies": {
"firebase-admin": "^9.2.0",
"firebase-functions": "^3.11.0",
"bad-words": "^3.0.3"
},
"devDependencies": {
"eslint": "^5.12.0",
"eslint-plugin-promise": "^4.0.1",
"firebase-functions-test": "^0.2.0"
},
"private": true
}

最佳答案

我的猜测是您在部署函数时正在部署一个本地的、过时的规则文件。

检查您的 firebase.json 以获取对 Firestore 规则文件的引用,和/或运行 firebase deploy --only functions

关于firebase - Firestore 规则不断变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65147969/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com