-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrules_database.json
57 lines (57 loc) · 2.13 KB
/
rules_database.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
{
"rules": {
".read": false,
".write": false,
"kartuGambar": {
".read": true,
"$kartu": {
".write": "newData.child('owner').val() == auth.uid || data.child('owner').val() == auth.uid",
".validate": "newData.hasChildren(['judul', 'tanda', 'ucapan', 'warna', 'foto', 'path', 'owner']) || data.hasChildren(['judul', 'tanda', 'ucapan', 'warna', 'foto', 'path', 'owner'])",
"suka": {
"$uid": {
".write": "auth.uid == $uid",
".validate": "newData.hasChild('liked') || data.hasChild('liked')",
"liked": { ".validate": true },
"$lain": { ".validate": false }
}
},
"komentar": {
"$komentar": {
".write": "newData.child('nama').val() == auth.uid || data.child('nama').val() == auth.uid",
"nama": { ".validate": true },
"pesan": { ".validate": "newData.val().length < 300" },
"$lain": { ".validate": false }
}
},
"judul": { ".validate": "newData.val().length < 20 || data.val().length < 20" },
"tanda": { ".validate": "newData.val().length < 20 || data.val().length < 20" },
"ucapan": { ".validate": "newData.val().length < 501 || data.val().length < 501" },
"warna": { ".validate": true },
"foto": { ".validate": true },
"path": { ".validate": true },
"owner": { ".validate": "newData.val() == auth.uid || data.val() == auth.uid" },
"pamerin": { ".validate": true },
"$lain": { ".validate": false }
}
},
"kartuUser": {
"$uid": {
".read": "auth.uid == $uid",
"$kartu": {
".write": "auth.uid == $uid",
"exist": { ".validate": true },
"$lain": { ".validate": false }
}
}
},
"users": {
"$uid": {
".read": "auth.uid != null",
".write": "auth.uid == $uid",
"username": { ".validate": "newData.val().length < 20 || data.val().length < 20" },
"displayName": { ".validate": "newData.val().length < 20 || data.val().length < 20" },
"$lain": { ".validate": false }
}
}
}
}