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.
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.
The RTDB has only three rule types: . read.
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.
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.
You must edit database.rules.json in your IDE then save it then deploy it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With