【发布时间】:2015-06-04 09:48:56
【问题描述】:
我正在创建一个 reddit 类型的应用程序。我有一系列故事,每个故事都有一个标题、描述和一个 voteCount。我想为 voteCount 设置单独的 .write 规则,所以我像这样构建了我的规则 -
"stories": {
"$story_id": {
"title": { ".write": "auth !== null" },
"description" { ".write": "auth !== null" },
"voteCount": { ".write": "newData.val() === data.val() + 1" },
}
}
这适用于现有故事。但是,这不再允许我添加新故事,除非我将 .write 规则直接添加到 $story_id 节点。当然,这会阻止我为 voteCount 节点设置特殊的 .write 规则。
关于为什么会发生这种情况的任何想法?
【问题讨论】:
标签: firebase angularfire firebase-security