I'm trying to create a web application that hosts data in the Firebase Real Database. When loading the page, a list of terms (a glossary) is displayed, which when pressed, leads to its detail. If the user logs in, then he can also edit the terms (create, modify, delete).
The rules I use in the Firebase console are:
{
"rules": {
"terms": {
".read": "auth != null",
".write": "auth != null && (!data.exists() || data.child('owner').val() === auth.uid)",
}
}
}
Therefore, when the user does not log in explicitly, it is automatically registered as anonymous user (Anonymous). However, every time you click on a term to see its contents, although you can see it, the message "failed: permission_denied" appears on the console.
All this is what appears when you see a single element:
I have searched for information and always offer as a solution to put true for ".read" and ".write" and I want them to be able to read (authenticated that as anonymous) and that only the owner user that is registered can write by email or another provider such as Google, or GitHub.
Thank you very much in advance!
Greetings