需要做什么?
数据库:
{
items: [
{
title: "some title",
content: "voila, some content",
author: {
uid: "FSDF-SDFSDF-SDFS-SFZE"
}
}, {
title: "some second title title",
content: "voila, some other content",
author: {
uid: "1234-234235-2342-2342"
}
}
]
}
规则:
"items": {
".read": true,
".write": "auth !== null",
"$item": {
".read": true,
".write": "auth !== null && auth.provider === 'password' or root.child('items/' + $item + '/author/uid').val() === auth.uid"
}
}
有什么问题?