Consider this JSON structure representing a Firebase DB:
{
"users": {
"user0": {
"name": "Mike",
"age": 20,
"relationship": "married",
"friends": [...]
},
"user1": {
"name": "Sarah",
"age": 20,
"relationship": "single",
"friends": [...]
},
...
}
}
If we utilize the Firebase permission system, can we grant access to name
and age
for all users by setting their permissions to true
, while limiting visibility of the relationship
status to a specific group, such as the user's friends
?
How should the security-rules.json
be configured to achieve this?