-
Notifications
You must be signed in to change notification settings - Fork 3
/
database.rules.json
51 lines (51 loc) · 1.71 KB
/
database.rules.json
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
{
"rules": {
"activity": {
".read": true,
".indexOn": "userId",
"$id": {
".write": "!data.exists() && auth !== null && newData.child('userId').val() === auth.uid"
}
},
"charities": {
".read": true,
"$uid": {
".write": "$uid === auth.uid"
}
},
"foodDonations": {
".read": true,
"$id": {
".write": "auth !== null && (newData.child('donorId').val() === auth.uid || data.child('donorId').val() === auth.uid)"
}
},
"nonfoodDonations": {
".read": true,
"$id": {
".write": "auth !== null && (newData.child('donorId').val() === auth.uid || data.child('donorId').val() === auth.uid)"
}
},
"reservations": {
".read": true,
"$donationId": {
".write": "auth !== null && (!data.exists() || data.child('deliveredOrReceived').val() === false)",
"deliveredOrReceived": {
".write": "(!data.exists() && newData.val() === false) || (data.exists() && data.parent().child('reserverId').val() === auth.uid && newData.val() === true)"
},
"reserverId": {
".write": "(!data.exists() && newData.val() === null) || (data.exists() && data.val() === null && newData.val() === auth.uid) || (data.exists() && newData.val() === null && data.val() === auth.uid)"
},
"type": {
".write": "(!data.exists() && newData.val() === null) || (data.exists() && data.parent().child('reserverId').val() === auth.uid) || (data.exists() && data.parent().child('reserverId').val() === null)"
}
}
},
"users": {
".read": false,
"$uid": {
".read": "$uid === auth.uid",
".write": "$uid === auth.uid"
}
}
}
}