【发布时间】:2014-06-17 02:17:35
【问题描述】:
我发现了一个使用 firebase 安全 API here 的基于权限的聊天室的简洁小示例
注意"chat": {
// the list of chats may not be listed (no .read permissions here)
实际上,当我加载用户的收件箱时,我需要列出用户所属的聊天记录,但我似乎无法正确获取 .read 规则。
我尝试使用以下规则,这完全有道理但不起作用:
"convos": {
".read" : "auth != null && data.child('users').hasChild(auth.id)",
我怀疑问题在于 convo 和用户之间仍然存在一个级别.. aka 这样做更有意义:
"convos": {
".read" : "auth != null && data.child($key + '/users').hasChild(auth.id)",
$key : { ... }
但这是不允许的,就是抱怨 $key 还不存在。
如何允许用户使用此设置提取他们所属的所有 convos?
【问题讨论】:
标签: firebase angularfire firebase-security