-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdatabase.rules.json
More file actions
29 lines (29 loc) · 873 Bytes
/
database.rules.json
File metadata and controls
29 lines (29 loc) · 873 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
{
"rules": {
"notifications": {
".read": "auth != null",
".write": "auth != null",
"$notificationId": {
".validate": "newData.hasChildren(['title', 'receipt', 'description', 'action_url', 'timestamp', 'createdBy'])",
"title": {
".validate": "newData.isString() && newData.val().length > 0"
},
"receipt": {
".validate": "newData.isString() || (newData.hasChildren() && newData.val().length > 0)"
},
"description": {
".validate": "newData.isString() && newData.val().length > 0"
},
"action_url": {
".validate": "newData.isString()"
},
"timestamp": {
".validate": "newData.isNumber()"
},
"createdBy": {
".validate": "newData.isString() && newData.val() == auth.uid"
}
}
}
}
}