【发布时间】:2019-03-14 09:50:24
【问题描述】:
有 2 个应用程序使用相同的 Firestore 数据。 1. 前端 2. 后端
前端 使用 jquery 仅显示数据。
后端 Angular7 管理应用,用于前端创建、更新、删除数据。
现在前端提示错误
错误:PERMISSION_DENIED:权限被拒绝
Firestore 规则
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if true;
}
}
}
代码
var dbRef = firebase.database();
var contactsRef = dbRef.ref("Slides");
//load older conatcts as well as any newly added one...
contactsRef.on("child_added", function(snap) {
console.log("added", snap.key(), snap.val());
$("#contacts").append(contactHtmlFromObject(snap.val()));
});
function contactHtmlFromObject(contact) {
console.log(contact);
var html = "";
html += '<li class="list-group-item contact">';
html += "<div>";
html += '<p class="lead">' + contact.name + "</p>";
html += "</div>";
html += "</li>";
return html;
}
【问题讨论】:
-
你能写出你试图执行的firestore请求吗?
-
更新问题。
标签: jquery firebase google-cloud-firestore firebase-security