-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.rules.json
More file actions
50 lines (50 loc) · 1.35 KB
/
database.rules.json
File metadata and controls
50 lines (50 loc) · 1.35 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
{
"rules": {
".read": false,
".write": false,
"users": {
"$uid": {
".read": "$uid === auth.uid",
".write": "$uid === auth.uid",
"profile": {
".validate": "newData.hasChildren(['email', 'createdAt', 'lastLogin'])",
"email": {
".validate": "newData.isString() && newData.val().matches(/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$/)"
},
"createdAt": {
".validate": "newData.isString()"
},
"lastLogin": {
".validate": "newData.isString()"
},
"$other": {
".validate": false
}
},
"todos": {
"$todoId": {
".validate": "newData.hasChildren(['todo', 'dodate', 'completed'])",
"todo": {
".validate": "newData.isString() && newData.val().length > 0"
},
"dodate": {
".validate": "newData.isString()"
},
"completed": {
".validate": "newData.isBoolean()"
},
"createdAt": {
".validate": "newData.isString()"
},
"lastUpdated": {
".validate": "newData.isString()"
},
"$other": {
".validate": false
}
}
}
}
}
}
}