rule
{
"rules": {
"rooms" : {
".read": "auth != null",
".write": "auth != null",
"$room_id" :{
".read": "root.child('rooms').child($room_id).child('read').val()=='true'",
".write": "root.child('rooms').child($room_id).child('write').val()=='true'",
}
}
}
}
{
"rules": {
"rooms" : {
".read": "auth != null",
".write": "auth != null",
"$room_id" :{
".read": "root.child('rooms').child($room_id).child('read').val()=='true'",
".write": "root.child('rooms').child($room_id).child('write').val()=='true'",
}
}
}
}
データベース
{
"rooms" : {
"-ROOM_ID_1" : {
"admin" : false,
"img_upload" : false,
"messages" : {
"-MB-NAtBV1ybNEUM-DVS" : {
"name" : "hoge.",
"text" : "テスト"
}
},
"read" : true,
"room_name" : "部屋1",
"write" : true
},
"-ROOM_ID_2" : {
"admin" : false,
"img_upload" : false,
"messages" : {
"-MB-BcDIyABa7Ngw23IM" : {
"name" : "hoge",
"text" : "テスト"
},
"-MB-NPjk4xd0h_JZTUjG" : {
"name" : "hoge",
"text" : "テスト"
}
},
"read" : true,
"room_name" : "部屋2",
"write" : true
}
}
}
{
"rooms" : {
"-ROOM_ID_1" : {
"admin" : false,
"img_upload" : false,
"messages" : {
"-MB-NAtBV1ybNEUM-DVS" : {
"name" : "hoge.",
"text" : "テスト"
}
},
"read" : true,
"room_name" : "部屋1",
"write" : true
},
"-ROOM_ID_2" : {
"admin" : false,
"img_upload" : false,
"messages" : {
"-MB-BcDIyABa7Ngw23IM" : {
"name" : "hoge",
"text" : "テスト"
},
"-MB-NPjk4xd0h_JZTUjG" : {
"name" : "hoge",
"text" : "テスト"
}
},
"read" : true,
"room_name" : "部屋2",
"write" : true
}
}
}