I am trying to set up a Firebase database that I can write. Thus, the user does not have permission to write anything. But everyone can read it.
However, I could not establish rules for him. I have one admin user that I created using the Email / Password login and I know its UID. Say my UID is: dJrGShfgfd2
I tried these two methods, but they did not allow me to write to the database.
{ "rules": { "events": { ".read": true, ".write": "auth.uid === 'dJrGShfgfd2'" } } }
.
{ "rules": { "users": { "$user_id": { ".read" : true, ".write": "$user_id === 'dJrGShfgfd2'" } } } }
So, how do I allow only one user with a specific UID to write something to the database?
source share