Firebase - secure the database from being deleted entirely

前提是你 提交于 2019-12-25 07:19:23

问题


Doing CRUD in firebase is pretty easy and neat IMO. But I am confuse on how to protect the whole database.

So I have this database rules :

{
    "rules": {
        ".read": "auth != null",
        ".write": "auth != null",
    }
}

Let's say I have a bunch of data on my database. If the user is not yet authenticated this code firebase.database().ref('/').set(null) is replying a permission_denied error which is normal.

But the problem is once a certain user logs in and gets authenticated, this code firebase.database().ref('/').set(null) will delete the entire database.

How do I secure this kind of setup? Also when I tried this code firebase.database().ref('/').set(null) on the javascript web console it still deletes the data.

来源:https://stackoverflow.com/questions/39438017/firebase-secure-the-database-from-being-deleted-entirely

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!