-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb.json
More file actions
30 lines (27 loc) · 869 Bytes
/
db.json
File metadata and controls
30 lines (27 loc) · 869 Bytes
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
{
/* Visit https://firebase.google.com/docs/database/security to learn more about security rules. */
"rules": {
".read": "true",
".write": "true",
"profiles": {
"$user_id": {
".write": "$user_id === auth.uid"
}
},
"posts": {
".indexOn": "created_at",
"$post": {
".write": "auth != null && !data.exists() || (!newData.exists() && data.child('user_id').val() === auth.uid)",
".validate": "newData.hasChildren(['user_id', 'created_at', 'image'])",
"create_at": {
".validate": "newData.val() <= now && newData.val() >= now - 60000"
},
"user_id": {
".validate": "newData.val() === auth.uid"
}
}
},
".indexOn": "email"
}
}
/*this is the setup of the firebase database*/