I read through the docs, and I'm not sure of the difference between the write-rule and validation-rule section. Is this code redundant? Any point of using one or the other, or both?
Specifically:
{
"rules": {
"users": {
".validate": "auth != null && newData.val() === auth.uid",
"$user_id": {
".write": "$user_id === auth.uid"
}
}
}
}
The only difference is that .validate doesn't propagate to its children.
Answering to your question, in your example you could use just ".write".
".write": "auth != null && $user_id === auth.uid"
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