-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase.rules.json
78 lines (63 loc) · 2.56 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
74
75
76
77
78
{
"rules": {
"rooms_private": {
"$room": {
".read": "data.child('uid_admins').hasChild(auth.uid)",
".write": "data.child('uid_admins').hasChild(auth.uid)",
".validate": "newData.hasChildren(['uid_admins', 'uid_participants'])",
"uid_admins": {
"$uid": { ".validate": "newData.isBoolean()" }
},
"uid_participants": {
"$uid": {
".read": "$uid === auth.uid",
"$day": {
"$time": { ".validate": "newData.isNumber() && newData.val() >= -2 && newData.val() <= 2" }
}
}
},
"$other": { ".validate": false }
}
},
"rooms_public": {
"$room": {
".read": true,
".write": "root.child('rooms_private').child($room).child('uid_admins').hasChild(auth.uid)",
".validate": "newData.hasChildren(['description', 'enabled', 'name', 'urlImage'])",
"description": { ".validate": "newData.isString() && newData.val().length < 120" },
"enabled": { ".validate": "newData.isBoolean()" },
"name": { ".validate": "newData.isString() && newData.val().length < 70" },
"urlImage": { ".validate": "newData.isString() && newData.val().length < 2000" },
"created": { ".validate": "newData.isNumber()" },
"$other": { ".validate": false }
}
},
"users_private": {
"$uid": {
".read": "$uid === auth.uid",
".write": "$uid === auth.uid",
".validate": "newData.hasChild('ids_rooms_as_participant')",
"ids_rooms_as_participant": {
"$room": { ".validate": "newData.isBoolean()" }
},
"$other": { ".validate": false }
}
},
"users_public": {
"$uid": {
".read": true,
".write": "$uid === auth.uid",
".validate": "newData.hasChildren(['email', 'name', 'urlImage'])",
"email": { ".validate": "newData.isString() && newData.val().length <= 254" },
"name": { ".validate": "newData.isString() && newData.val().length <= 70" },
"urlImage": { ".validate": "newData.isString() && newData.val().length <= 2000" },
"creationTime": { ".validate": "newData.isString()" },
"emailVerified": { ".validate": "newData.isBoolean()" },
"lastSignInTime": { ".validate": "newData.isString()" },
"nameGoogle": { ".validate": "newData.isString() && newData.val().length <= 70" },
"urlImageGoogle": { ".validate": "newData.isString() && newData.val().length <= 2000" },
"$other": { ".validate": false }
}
}
}
}