读取失败:权限在firebase中拒绝错误 [英] The read failed: Permission denied error in firebase

查看:144
本文介绍了读取失败:权限在firebase中拒绝错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注这个链接的教程。 Android中的firebase。我只是试图添加一个名称和地址的firebase,并反映在所有的应用程序中添加的名称。我尝试了,但是当我回到代码时,我得到了错误

 读取失败:权限被拒绝的错误

我没有在这里添加任何权限,我现在不想在这里做任何限制。我只是想让所有的用户都可以访问。如何添加以及需要做什么?请帮忙 。我是一个新手。任何帮助都很棒

解决方案

该教程是为www.firebase.com上的传统Firebase创建的。当你在那里创建一个项目时,它默认是可读写的。

console.firebase.google.com/rel =noreferrer>新的Firebase控制台。那些项目默认情况下只能由经过验证的用户读写。



目前最简单的解决方法是(直到教程更新),进入控制台为您的项目,选择规则选项卡,并用这些规则替换内容:

  {
rules: {
.read:true,
.write:true
}
}

这使得每个人都可以读取和写入新的数据库,就像在旧版Firebase中一样。一旦你完成了本教程,一定要保护你的数据库,否则有人可能会开始滥用它。


I am following a tutorial from this link for firebase in android. I am just trying to add a name and address to the firebase and reflect the added name in all the app. I tried but when I rean the code, I got the error

"The read failed: Permission denied error "

I didn't add any permissions here and I don't want any restrictions to be done here as of now. I just want to make all the users accessible. How to add that and what needs to be done? Please help . I am a newbie. Any help would be great

解决方案

That tutorial was created for the "legacy" Firebase on www.firebase.com. When you create a project there, it is by default readable and writable by anyone.

I guess that you created your project on the new Firebase Console. Projects there are by default only readable and writable by authenticated users.

The simplest workaround for the moment (until the tutorial gets updated) is to go into the Database panel in the console for you project, select the Rules tab and replace the contents with these rules:

{
  "rules": {
    ".read": true,
    ".write": true
  }
}

This makes your new database readable and writeable by everyone, like in the legacy Firebase. Be certain to secure your database again once you're done with the tutorial, otherwise somebody is likely to start abusing it.

这篇关于读取失败:权限在firebase中拒绝错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆