-
Notifications
You must be signed in to change notification settings - Fork 1
/
rules.txt
25 lines (25 loc) · 918 Bytes
/
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
{
"rules": {
"users": {
"$user_id": {
".read": "auth != null &&
auth.uid == $user_id ||
root.child('users/' + auth.uid + '/roomId').val() == data.child('roomId').val()",
".write": "auth != null &&
auth.uid == $user_id ||
root.child('users/' + auth.uid + '/roomId').val() == data.child('roomId').val()"
}
},
"rooms": {
"$room_id": {
".read": "auth != null &&
data.child('/started').val() == false ||
data.child('/users/' + auth.uid).exists()",
".write": "auth != null &&
!data.exists() ||
data.child('started').val() == false ||
data.child('/users/' + auth.uid).exists()"
}
}
}
}