-
Notifications
You must be signed in to change notification settings - Fork 5
/
firebase.rules.json
147 lines (147 loc) · 4.62 KB
/
firebase.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
{
"rules": {
".read": false,
".write": false,
"profiles": {
"$owner_id": {
".read": "true",
".write": "auth != null && $owner_id === auth.uid || auth != null && root.child('admin').hasChild(auth.uid)"
}
},
"rooms": {
"$roomID": {
"$owner_id": {
".read": "true",
".write": "auth != null && $owner_id === auth.uid || auth != null && root.child('admin').hasChild(auth.uid)"
}
}
},
"online": {
"$roomID": {
".read": "true",
"$owner_id": {
".read": "true",
".write": "auth != null && $owner_id === auth.uid || auth != null && root.child('admin').hasChild(auth.uid)"
}
}
},
"usernames": {
"$username": {
".write": "!data.exists() && auth!= null && newData.val() == auth.uid"
}
},
"slug": {
".read": true,
"$slugID": {
".write": "(!data.exists() || data.child('author').val() == auth.uid) && (newData.child('author').val() == auth.uid || !newData.exists())"
}
},
"assets": {
".read": true,
"$assetID": {
".write": "root.child('admins/'+auth.uid).exists()"
}
},
"card-private-info": {
".read": "root.child('admins/'+auth.uid).exists()",
".write": "root.child('admins/'+auth.uid).exists()"
},
//
"card-public-meta": {
"$cardID": {
".read": "root.child('admins/'+auth.uid).exists()",
".write": "root.child('admins/'+auth.uid).exists()"
}
},
"card-activation-info": {
"$cardID": {
".read": true,
".write": "root.child('admins/'+auth.uid).exists()"
}
},
"card-stroy-draft": {
"$cardID": {
".read": true,
".write": "root.child('card-activation-info').child($cardID).child('uid').exists() && auth != null && root.child('card-activation-info').child($cardID).child('uid').val() == auth.uid"
}
},
"card-stroy-info": {
"$cardID": {
".read": true,
".write": "root.child('card-activation-info').child($cardID).child('uid').exists() && auth != null && root.child('card-activation-info').child($cardID).child('uid').val() == auth.uid"
}
},
"card-avatar-info": {
"$cardID": {
".read": true,
".write": "root.child('card-activation-info').child($cardID).child('uid').exists() && auth != null && root.child('card-activation-info').child($cardID).child('uid').val() == auth.uid"
}
},
"card-room-info": {
"$cardID": {
".read": true,
".write": "root.child('card-activation-info').child($cardID).child('uid').exists() && auth != null && root.child('card-activation-info').child($cardID).child('uid').val() == auth.uid"
}
},
"card-meta-info": {
"$cardID": {
".read": true,
".write": "root.child('admins/'+auth.uid).exists()"
}
},
"test-admin": {
".read": "root.child('admins/'+auth.uid).exists()",
".write": "root.child('admins/'+auth.uid).exists()"
},
"test-user": {
".read": "auth !== null && auth.provider === 'google'",
".write": "auth !== null && auth.provider === 'google'"
},
"profile": {
"$owner_user_id": {
"canvas": {
".read": "auth !== null",
"$canvasID": {
".write": "auth !== null && auth.uid === $owner_user_id",
"shareACL": {
".write": "auth !== null && auth.uid === $owner_user_id",
},
"ownerACL": {
".write": "auth !== null && auth.uid === $owner_user_id",
}
},
},
"layout": {
".read": "auth !== null",
"$canvasID": {
".write": "auth !== null && auth.uid === $owner_user_id",
"shareACL": {
".write": "auth !== null && auth.uid === $owner_user_id",
},
"ownerACL": {
".write": "auth !== null && auth.uid === $owner_user_id",
}
},
}
},
},
"canvas": {
"$canvasID": {
".read": true,
"$ownerID": {
".read": true,
".write": "auth !== null && auth.uid === $ownerID || auth !== null && root.child('profile').child($ownerID).child('canvas').child($canvasID).child('shareACL').hasChild(auth.uid)"
}
}
},
"layout": {
"$layoutID": {
".read": true,
"$ownerID": {
".read": true,
".write": "auth !== null && auth.uid === $ownerID || auth !== null && root.child('profile').child($ownerID).child('layout').child($layoutID).child('shareACL').hasChild(auth.uid)"
}
}
}
}
}