How can i to use unique id of new data in rule with newData?
Data structure:
I want to disallow to write for the users which one senderName is in ban_users, but i cannot to get the newData senderName:
newData('senderName').val(); //not working
newData('$message_id/senderName').val(); //also not working("$message_id": {})
To disallow writes to messages/main/$id
, try the following write rule:
!root.child('chat/ban_users').hasChild(newData.child('senderName').val())
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments