FireBase rule newData with uid

Suleiman

How can i to use unique id of new data in rule with newData?

Data structure: enter image description here

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": {})
Rob DiMarco

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.

edited at
0

Comments

0 comments
Login to comment

Related