forked from luizfar/firedeaz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
database.rules.json
73 lines (73 loc) · 2.11 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
"rules": {
"boards": {
"$boardId": {
".validate": "newData.hasChildren(['boardId', 'user_id', 'max_votes', 'date_created'])",
"boardId": {
".validate": "newData.isString()"
},
"user_id": {
".validate": "newData.val().length > 0 && newData.val() == auth.uid"
},
"max_votes": {
".validate": "newData.isNumber()"
},
"date_created": {
".validate": "newData.isString() || newData.isNumber()"
},
"text_editing_is_private": {
".validate": "newData.isBoolean()"
},
"columns": {
".validate": "newData.hasChildren()"
},
"boardContext": {
".validate": "newData.isString()"
},
"hide_vote": {
".validate": "newData.isBoolean()"
},
"$other": {
".validate": "false"
},
".read": "data.child('user_id').val() == auth.uid",
".write": "newData.child('user_id').val() == auth.uid"
}
},
"messages": {
"$boardId": {
"$messageId": {
".validate": "newData.hasChildren(['text', 'creating', 'user_id', 'type', 'date', 'date_created'])",
"text": {
".validate": "newData.isString()"
},
"creating": {
".validate": "newData.isBoolean()"
},
"user_id": {
".validate": "newData.val().length > 0 && newData.val() == auth.uid"
},
"type": {
".validate": "newData.hasChildren()"
},
"date": {
".validate": "newData.isString() || newData.isNumber()"
},
"date_created": {
".validate": "newData.isString() || newData.isNumber()"
},
"votes": {
".validate": "newData.isNumber()"
},
"$other": {
".validate": "false"
},
".read": "data.child('user_id').val() == auth.uid",
".write": "newData.child('user_id').val() == auth.uid"
},
".read": "auth != null",
".write": "auth != null"
}
}
}
}