【发布时间】:2015-12-18 14:08:07
【问题描述】:
需要做什么?
- 每个人都可以阅读项目。
- 登录的每个人都可以将项目写入数据库。
- 每个人都可以使用自己的 uid 作为作者来编辑项目。
- 通过密码(不是 twitter...)登录的用户是版主,可以编辑所有项目。
数据库:
{
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"
}
}
怎么了?
【问题讨论】:
-
对不起..还没有完全...还没有时间完成这个。当我有时间完成那个项目时会要求更多。希望很快。
标签: json firebase firebase-security