Pages

05 April, 2024

Firebase realtime rules - not working on child

Building a Firebase Realtime database with auth - but I
can't even get this started - returns permission denied
{
"rules": {
"forms": {
"$formid": {
".read": "true",
".write": "true"
}
}
}
}



ultimately I'd like to apply a rule like such
{
"rules": {
"forms": {
"$formid": {
".read": "auth.uid == data.child('userId').val()",
".write": "auth.uid != 'null'"
}
}
}
}



Data is formatted
forms




* $formId (eg -Nan39eo)



* userId










Console logging when rules are changed at the root to true returns that my authid is the same as the formId.userId

No comments:

Post a Comment

Thanks