I have a many to many relationship, users can manage many restaurants and restaurants can have many managers
by default users phone numbers are hidden but i want them to be available to other managers who manage the same restaurants as they do
I’ve added a field on the user Restaurants managing and on the restaurant managers, so my data could look like this:
Restaurants:
R1 {
“managers”: [U1, U2]
}
Users:
U1 {
“manages”: [R1, R2]
}
U2 {
“manages”: [R2]
}
U1 and U2 should be able to view each others phone numbers because they both manage the same restaurant but i can’t seem to write the privacy rule.
Am i storing my data correctly? how can i create the necessary privacy rule to allow them to view each others phone numbers?