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.