-
Notifications
You must be signed in to change notification settings - Fork 11
/
rules.json
120 lines (120 loc) · 3.49 KB
/
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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
{
"rules": {
".read" : false,
".write" : false,
"queue": {
".read": false,
".write": "auth!=null",
".indexOn": "_state",
"$taskID": {
".validate": "newData.hasChildren(['user', 'username', 'message', 'published']) || newData.hasChildren(['_state', '_state_changed', '_progress'])",
"_state": {
".validate": "newData.isString()"
},
"_state_changed": {
".validate": "newData.isNumber() && (newData.val() === now || data.val() === newData.val())"
},
"_owner": {
".validate": "newData.isString()"
},
"_progress": {
".validate": "newData.isNumber() && newData.val() >= 0 && newData.val() <= 100"
},
"_error_details": {
"error": {
".validate": "newData.isString()"
},
"previous_state": {
".validate": "newData.isString()"
},
"original_task": {
/* This space intentionally left blank, prevents $other from matching on malformed task */
},
"$other": {
".validate": false
}
},
"user": {
".validate": "newData.val() === auth.uid"
},
"username": {
".validate": "newData.val() === root.child('users/' + auth.uid + '/username').val()"
},
"message": {
".validate": "newData.isString()"
},
"published": {
".validate": "newData.isNumber()"
},
"$other": {
".validate": false
}
}
},
"jobs" : {
".read": false,
".write": false,
"$jobID": {
".validate": "newData.hasChild('in_progress_state')",
"start_state": {
".validate": "newData.isString()"
},
"in_progress_state": {
".validate": "newData.isString()"
},
"finished_state": {
".validate": "newData.isString()"
},
"error_state": {
".validate": "newData.isString()"
},
"timeout": {
".validate": "newData.isNumber() && newData.val() > 0"
},
"$other": {
".validate": false
}
}
},
"messages": {
".read": "auth!=null",
".write": false,
"$messageID": {
".validate": "newData.hasChildren(['user', 'username', 'message', 'published'])",
"user": {
".validate": "newData.val() === auth.uid"
},
"username": {
".validate": "newData.val() === root.child('users/' + auth.uid + '/username').val()"
},
"message": {
".validate": "newData.isString()"
},
"published": {
".validate": "newData.isNumber()"
},
"$other": {
".validate": false
}
}
},
"users": {
".read": true,
".write": false,
"$userID": {
".read": "auth.uid === $userID",
".write": "auth.uid === $userID",
".validate": "newData.hasChildren(['pic', 'username'])",
"username": {
".validate": "newData.isString()"
},
"pic": {
".validate": "newData.isString()"
},
"$other": {
".validate": false
}
}
}
}
}