This repository was archived by the owner on May 19, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathchat.json
More file actions
56 lines (56 loc) · 2.17 KB
/
chat.json
File metadata and controls
56 lines (56 loc) · 2.17 KB
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
{
"rules": {
"rooms": {
"$key1": {
".validate": "newData.hasChildren(['name', 'creator']) && $key1.length >= 1 && $key1.length <= 32",
"name": {
".validate": "newData.val().length > 0 && newData.val().length <= 32"
},
"creator": {
".validate": "newData.isString() && auth != null && newData.val() == auth.uid"
},
"members": {
"$key2": {
".validate": "newData.hasChildren(['nickname', 'isBanned'])",
"nickname": {
".validate": "newData.val().length > 0 && newData.val().length <= 32"
},
"isBanned": {
".validate": "newData.isBoolean()"
},
"$other": {
".validate": "false"
},
".write": "data.val() == null && auth != null && $key2 == auth.uid"
}
},
"$other": {
".validate": "false"
},
".read": "data.child('members').child(auth.uid).val() != null && !(data.child('members').child(auth.uid).child('isBanned').val() == true) || auth != null && data.child('creator').val() == auth.uid",
".write": "data.val() == null || auth != null && newData.child('creator').val() == auth.uid"
}
},
"posts": {
"$roomid": {
".validate": "root.child('rooms').child($roomid).val() != null",
"$postid": {
".validate": "newData.hasChildren(['from', 'message', 'created'])",
"from": {
".validate": "newData.isString() && auth != null && newData.val() == auth.uid"
},
"message": {
".validate": "newData.isString() && newData.val().length > 0 && newData.val().length <= 140"
},
"$other": {
".validate": "false"
},
".write": "data.val() == null && root.child('rooms').child($roomid).child('members').child(auth.uid).val() != null && !(root.child('rooms').child($roomid).child('members').child(auth.uid).child('isBanned').val() == true)",
"created": {
".validate": "newData.isNumber() && newData.val() == (data.val() == null ? now : data.val())"
}
}
}
}
}
}