This is my firebase rules
{
"rules": {
".read": "auth != null",
".write": "root.child('users/auth.id/user_type').val() == 'admin'"
}
}
My users node. (Data is faked)
{
"users" : {
"2anxMpsdsxsd5K2" : {
"user_email" : "dsds@gmail.com",
"user_name" : "dsd",
"user_photo_url" : "somepic.jpg",
"user_roles" : {
"writer" : true
}
},
"z8uzffddelsSl1" : {
"user_email" : "xcxc@gmail.com",
"user_name" : "xcxc",
"user_photo_url" : "fb-picture",
"user_type" : "admin"
}
}
}
I tried with user roles but was still denied from writing. Would my rules be the one that's faulty?