-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.rules.json
More file actions
22 lines (22 loc) · 834 Bytes
/
database.rules.json
File metadata and controls
22 lines (22 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"rules": {
"users": {
"$userId": {
".read": "$userId === auth.uid",
".write": "$userId === auth.uid"
}
},
"children": {
"$childId": {
".read": "auth != null",
".write": "root.child('users').child(auth.uid).child('childrenIds').child($childId).val() === true || (!data.exists() && auth != null)"
}
},
"families": {
"$familyId": {
".read": "root.child('users').child(auth.uid).child('families').child($familyId).exists()",
".write": "(!data.exists() && newData.child('createdBy').val() === auth.uid) || root.child('users').child(auth.uid).child('families').child($familyId).child('role').val() === 'admin' || root.child('users').child(auth.uid).child('families').child($familyId).child('role').val() === 'member'"
}
}
}
}