forked from FirebaseExtended/firebase-queue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrules.json
109 lines (109 loc) · 4.17 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
{
"rules": {
"queue": {
"alltasks": {
".read": "auth.uid === 'kubric-fbqueue-admin'",
".write": "auth.uid === 'kubric-fbqueue-admin'",
"$user": {
".read": "auth.uid === 'kubric-fbqueue-admin' || auth.uid === $user",
".write": "auth.uid === 'kubric-fbqueue-admin'",
".indexOn": ["user","__type__", "__app__", "__index__","__app_jobtype__"],
}
},
"apps": {
".read": "auth.uid === 'kubric-fbqueue-admin'",
".write": "auth.uid === 'kubric-fbqueue-admin'",
"$app": {
".read": "auth.uid === 'kubric-fbqueue-admin'",
".write": "auth.uid === 'kubric-fbqueue-admin'",
"$jobtype": {
".read": "auth.uid === 'kubric-fbqueue-admin'",
".write": "auth.uid === 'kubric-fbqueue-admin'",
"specs": {
".read": "auth.uid === 'kubric-fbqueue-admin'",
".write": "auth.uid === 'kubric-fbqueue-admin'",
".indexOn": ["error_state"],
"$specId": {
".read": "auth.uid === 'kubric-fbqueue-admin'",
".write": "auth.uid === 'kubric-fbqueue-admin'",
".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"
},
"retries": {
".validate": "newData.isNumber() && newData.val() >= 0"
},
"$other": {
".validate": true
}
}
},
"tasks": {
".read": "auth.uid === 'kubric-fbqueue-admin' || true",
".write": "auth.uid === 'kubric-fbqueue-admin'",
".indexOn": ["user", "_state", "__type__", "__app__", "__wfstatus__", "__index__", "__index_wfstatus__"],
"$taskId": {
".read": "auth.uid === 'kubric-fbqueue-admin' || data.child('user').val() === auth.uid",
".write": "auth.uid === 'kubric-fbqueue-admin'",
".validate": "newData.hasChildren(['__type__']) || (auth.canProcessTasks === true && 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()"
},
"error_stack": {
".validate": "newData.isString()"
},
"previous_state": {
".validate": "newData.isString()"
},
"original_task": {
/* This space intentionally left blank, for malformed tasks */
},
"attempts": {
".validate": "newData.isNumber() && newData.val() > 0"
},
"$other": {
".validate": false
}
},
"_id": {
".validate": "newData.isString()"
},
"type": {
".validate": "newData.isString()"
},
"$other": {
".validate": true
}
}
}
}
}
}
}
}
}