Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rules in Firebase database revert to original

I'm developing a proof-of-concept application, and thus my security requirements are low. I therefore changed the access rules to public access:

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

This works as expected. The problem is that after a few minutes, the rules change back to default values (auth required) and I get an access error "Error: permission_denied at /cases: Client doesn't have permission to access the desired data."

Why on earth is this so?

Thanks.

like image 697
Vespas Avatar asked Dec 27 '16 17:12

Vespas


People also ask

How do I change the Realtime Database rules in Firebase?

Edit and update your rulesOpen the Firebase console and select your project. Then, select Realtime Database, Cloud Firestore or Storage from the product navigation, then click Rules to navigate to the Rules editor. Edit your rules directly in the editor.

How many rules are you used to secure Realtime Database?

The RTDB has only three rule types: . read.

How can I recover my Firebase database?

Asynchronous listeners: Data stored in a Firebase Realtime Database is retrieved by attaching an asynchronous listener to a database reference. The listener is triggered once for the initial state of the data and again anytime the data changes. An event listener may receive several different types of events.

What is callback in Firebase?

If a callback function is provided, it will be called when the response from Firebase is received. The callback function has two parameters: error and data. If no error was encountered, error will be null . If any error occurred, an error message will be passed to the callback's error parameter.


1 Answers

You must edit database.rules.json in your IDE then save it then deploy it.

like image 54
Ronnie Royston Avatar answered Sep 28 '22 15:09

Ronnie Royston