Repository navigation
Expand file tree
/
Copy pathdatabase.rules.json
More file actions
102 lines (90 loc) · 3.44 KB
/
Copy pathdatabase.rules.json
File metadata and controls
102 lines (90 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{
"rules": {
".read": false,
".write": false,
"verifiedUsers": {
"$uid": {
".read": "auth != null && auth.uid == $uid",
".write": "auth != null && auth.uid == $uid"
}
},
"verifiedUsersByPhone": {
".read": "auth != null",
"$phoneKey": {
".write": "auth != null && (!data.exists() || data.child('uid').val() == auth.uid || newData.child('uid').val() == auth.uid || !newData.exists())"
}
},
"members": {
".read": "auth != null",
".indexOn": ["name", "phoneKey", "uid"],
"$phoneKey": {
".write": "auth != null && (!data.exists() || data.child('uid').val() == auth.uid || newData.child('uid').val() == auth.uid || !newData.exists())"
}
},
"subscriptionMemberships": {
"$uid": {
".read": "auth != null && auth.uid == $uid",
".write": "auth != null && auth.uid == $uid"
}
},
"subscriptions": {
".read": "auth != null",
".indexOn": ["groupID", "uid", "status"],
"$subscriptionId": {
".write": "auth != null && ($subscriptionId == auth.uid || data.child('uid').val() == auth.uid || newData.child('uid').val() == auth.uid || data.child('members').child(auth.uid).exists() || newData.child('members').child(auth.uid).exists())",
".validate": "!newData.exists() || !newData.child('subscriptionMemberLimit').exists() || (newData.child('subscriptionMemberLimit').isNumber() && newData.child('subscriptionMemberLimit').val() >= 1 && newData.child('subscriptionMemberLimit').val() <= 8)",
"members": {
"$uid": {
".write": "auth != null && (auth.uid == $uid || root.child('subscriptions').child($subscriptionId).child('uid').val() == auth.uid || root.child('subscriptions').child($subscriptionId).child('members').child(auth.uid).child('isOwner').val() == true)"
}
}
}
},
"groups": {
".read": "auth != null",
".write": "auth != null",
".indexOn": ["active", "createdByID", "isArchived", "isSubscriptionInviteStaging"],
"$groupId": {
".validate": "!newData.exists() || !newData.child('maxMemberCount').exists() || newData.child('maxMemberCount').val() <= 8"
}
},
"receipts": {
".read": "auth != null",
".write": "auth != null",
".indexOn": ["groupID", "expiresAt", "createdByID"]
},
"paymentRequests": {
".read": "auth != null",
".write": "auth != null",
".indexOn": ["status", "receiptId", "toPhone", "fromPhone", "createdAt"]
},
"userBalances": {
"$uid": {
".read": "auth != null && auth.uid == $uid",
".write": "auth != null",
".indexOn": ["status", "createdAt", "updatedAt", "receiptId"]
}
},
"userBalancesByPhone": {
"$phoneKey": {
".read": "auth != null && (root.child('members').child($phoneKey).child('uid').val() == auth.uid || root.child('verifiedUsersByPhone').child($phoneKey).child('uid').val() == auth.uid)",
".write": "auth != null",
".indexOn": ["status", "createdAt", "updatedAt", "receiptId"]
}
},
"groupActivity": {
"$groupId": {
".read": "auth != null",
".write": "auth != null",
".indexOn": ["timestamp", "type", "receiptBatchID"]
}
},
"userActivity": {
"$phoneKey": {
".read": "auth != null",
".write": "auth != null",
".indexOn": ["timestamp", "type", "receiptBatchID"]
}
}
}
}