reactjs - 错误:permission_denied at /categories:客户端无权访问所需数据
问题描述
我有一个招聘人员给我的任务,在这里我需要使用 react redux 和 firebase 建立一个电子商务网站。
前端部分已完成,但无法从 firebase 获取数据。这是我的规则选项卡内容我该如何修改它。
this.props.firebase.categories().on('value', snapshot => {
// Not coming here.
console.log(snapshot, snapshot.val)
}, (error) => {
// Error shows here
console.log(error);
});
// Content of Rules tab
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if true;
}
}
}
解决方案
在规则(firebase)中将读取和写入权限设置为 true。
推荐阅读
- c# - 我如何从列表中获取工作 ID
- python-2.7 - 如何在 Pyside2 的 QTabWidget 中更改特定选项卡的字体?
- php - 将内容添加到预先存在的网页
- python - 如何在任何地方使用免费的在线服务器(如 python)每天在同一时间运行 python 脚本?
- jquery - 通过 Ajax 调用重新绑定(或重新加载)Fullcalendar 数据
- nhibernate - 如何处理大结果集而不将其加载到内存中
- c# - 如何使用 REST API 更新 SharePoint 在线文件的元数据?
- c# - 自动将命名空间添加到 Unity C# 脚本
- javascript - 从 Javascript 对象中删除项目
- angular - Angular2:订阅对象以将对象的值与服务绑定