forked from ShareDropio/sharedrop
-
Notifications
You must be signed in to change notification settings - Fork 1
/
firebase_rules.json
28 lines (26 loc) · 1.03 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
{
"rules": {
"rooms": {
"$roomid": {
// You can see people in the room only if you are in it as well
".read": "auth != null && data.child('users').hasChild(auth.id)",
"users": {
"$userid": {
// You can modify only your own info
".write": "auth != null && $userid == auth.id",
// Ensure that all required attributes are there
".validate": "newData.hasChildren(['uuid', 'public_ip', 'peer']) && newData.child('peer').hasChildren(['id'])"
}
},
"messages": {
// You can send message to anybody in the room
".write": "auth != null",
"$userid": {
// You can read only messages sent to you
".read": "auth != null && $userid == auth.id"
}
}
}
}
}
}