Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • Thank you for your reply. But I do not know the id of the conversation. I want to list the conversations that contain the uid of the connected user Commented Dec 30, 2020 at 21:20
  • That requires a query, which is not possible in the Firebase console and rules playground. But my answer shows how to secure chat child nodes so that only a user that is in each room has access to them. Commented Dec 30, 2020 at 21:41
  • After the rule change the chats are no longer accessible Commented Jan 4, 2021 at 21:40
  • That is correct. With these rules you can no longer read the Chats node. If you want to allow the user to read a subset of the nodes under Chat, have a look at firebase.google.com/docs/database/security/… Commented Jan 5, 2021 at 0:30
  • I tried this option but it works if I had a property with the auth.id but it is an array of users. Each Chat contains an array of users. Thanks for your help Commented Jan 5, 2021 at 8:01