-
Notifications
You must be signed in to change notification settings - Fork 2
/
database.rules.json
51 lines (51 loc) · 1.63 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": {
"event": {
".read": true,
"$event_id": {
".write": "newData.exists() || auth.id === 'not-a-real-key'",
"eventname": {
".write": "!data.exists() && newData.exists()",
".validate": "newData.isString() && newData.val().length <=100"
},
"eventLocation": {
".write": "!data.exists()",
".validate": "newData.isString() && newData.val().length <=100"
},
"eventDesc": {
".write": "!data.exists()",
".validate": "newData.isString() && newData.val().length <=100"
},
"hostName": {
".write": "!data.exists()",
".validate": "newData.isString() && newData.val().length <=100"
},
"hostEmail": {
".write": "true",
".validate": "newData.val().length <=100"
},
"dates": {
"$date": { "participants": { ".write": "newData.exists()" } }
},
"admin": {
".write": "!data.exists()",
".validate": "newData.isString() && newData.val().length <=100"
},
"created": {
".write": "!data.exists()",
".validate": "newData.isNumber() && newData.val()<1000000000000"
},
"deleteAt": {
".write": "newData.exists() && (newData.val()< data.val() || !data.exists())",
".validate": "newData.isNumber() && newData.val()<1000000000000"
},
"active": {
".write": "!data.exists()",
".validate": "newData.isBoolean()"
},
"$other": { ".validate": false }
},
".indexOn": ["admin", "deleteAt"]
}
}
}