Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

How to allow read in firebase to a user if both requesting user and requested user exist in the same document?

$
0
0

I want to formulate a firebase security rule where:a user with a document in the users collection is allowed read in a driver document in the drivers collection;if there exists atleast one document in the travels collection where both the driver and user exist, in the form of userId and driverId parameters.

Documents:

drivers/id11111111users/id2222222222travels/ididididid

travels ididididid document:

driverId: id11111111userId: id2222222222

If the above document exists the id2222222222 user should be allowed to read the id11111111 driver document.

Both driver and user is a different categories of user from Firebase auth.


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>