-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.rules.json
More file actions
38 lines (38 loc) · 1.46 KB
/
database.rules.json
File metadata and controls
38 lines (38 loc) · 1.46 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
{
"rules": {
"users": {
"$uid": {
".read": "$uid === auth.uid",
".write": "$uid === auth.uid",
".validate": "newData.hasChildren(['email', 'name'])"
}
},
"events": {
".read": true,
"$eventID": {
".write": "auth != null",
".validate": "newData.hasChild('interestedUsers') || newData.hasChild('attendingUsers') || newData.hasChildren(['title', 'creator', 'location', 'startTime', 'endTime'])",
"title": {
".write": "newData.child('creator').val() === auth.uid",
".validate": "newData.isString() && newData.val().length > 1"
},
"location": {
".write": "newData.child('creator').val() === auth.uid",
".validate": "newData.isString() && newData.val().length > 2"
},
"startTime": {
".write": "newData.child('creator').val() === auth.uid",
".validate": "newData.isNumber()"
},
"endTime": {
".write": "newData.child('creator').val() === auth.uid",
".validate": "newData.isNumber()"
},
"attendingUsers": {
".write": true},
"interestedUsers": {
".write": true}
}
}
}
}