-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfirebase_rules.txt
35 lines (33 loc) · 902 Bytes
/
firebase_rules.txt
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
{
"rules": {
"rooms": {
"$room_id": {
// only members of rooms should be able to see the room info.
".read": "data.child('members/'+auth.uid).exists()",
// only administrators of rooms should be able to edit the room info.
".write": "data.child('administrators/'+auth.uid).exists()",
}
},
"members":{
"$room_id": {
".read": true,
".write": true
}
},
"messages": {
"$room_id": {
// only members of rooms should be able to see and add to the messages for a room.
".read": "root.child('rooms/'+$room_id+'/members/'+auth.uid).exists()",
".write": "root.child('rooms/'+$room_id+'/members/'+auth.uid).exists()"
}
},
"users": {
"$uid": {
"favorites" : {
".read": "$uid === auth.uid"
},
".write": "$uid === auth.uid"
}
}
}
}