-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirebase.rules.json
More file actions
40 lines (40 loc) · 1.37 KB
/
Copy pathfirebase.rules.json
File metadata and controls
40 lines (40 loc) · 1.37 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
{
"rules": {
"api_keys": {
".read": "auth != null",
"$key": {
".write": "auth != null && (root.child('api_keys/' + $key + '/userId').val() === auth.uid || root.child('admins/' + auth.uid).exists())",
".validate": "newData.hasChildren(['userId', 'name', 'createdAt']) && newData.child('userId').val() != null && newData.child('name').val() != null && newData.child('createdAt').val() != null"
}
},
"food_data": {
".read": true,
".write": false
},
"users": {
"$uid": {
".read": "auth != null && (auth.uid === $uid || root.child('admins/' + auth.uid).exists())",
".write": "auth != null && (auth.uid === $uid || root.child('admins/' + auth.uid).exists())",
".validate": "newData.hasChild('email')"
}
},
"api_keys_by_user": {
"$uid": {
".read": "auth != null && auth.uid === $uid",
".write": "auth != null && auth.uid === $uid"
}
},
"admins": {
".read": "auth != null && root.child('admins/' + auth.uid).exists()",
".write": "auth != null && root.child('admins/' + auth.uid).exists()"
},
"usage_logs": {
".read": "auth != null && root.child('admins/' + auth.uid).exists()",
".write": "auth != null"
},
"stats": {
".read": true,
".write": "auth != null && root.child('admins/' + auth.uid).exists()"
}
}
}