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

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

问题描述

我正在关注此链接中的教程安卓中的火力点.我只是想向 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

推荐答案

该教程是为 www.firebase.com 上的旧版"Firebase 创建的.当您在那里创建项目时,默认情况下任何人都可以对其进行读写.

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.

我猜您是在新 Firebase 控制台上创建了您的项目.默认情况下,那里的项目只能由经过身份验证的用户读取和写入.

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
  }
}

这使您的新数据库对所有人都可读和可写,就像在旧版 Firebase 中一样.完成本教程后,请务必再次保护您的数据库,否则有人可能会开始滥用它.

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天全站免登陆