【发布时间】:2014-12-19 06:05:11
【问题描述】:
我正在尝试根据收件人显示邮件列表,但现在,让我们保持简单。我只是想显示一个消息列表。
我的规则是这样的
{
"rules": {
"communications" : {
"$communication":{
".read" : true,
".write": true
}
}
}
由于某种原因,我的应用程序不想阅读它
fireRef = new Firebase(url);
fireRef.auth(MY_TOKEN);
commsRef = fireRef.child('communications')
$scope.communications = $firebase(commsRef)
只有当我有一个看起来像这样的规则时它才有效
{
"rules": {
"communications" : {
".read" : true,
".write": true
}
}
但这会导致问题,因为我想在我的通信的子节点上添加条件。比如:
{
"rules": {
"communications" : {
".read" : true, ### I would like to get rid of this line as well and have the child handling it
".write": true,
"$communication":{
".read" : "data.child('to').val() == auth.uid"
}
}
}
我假设这是因为我在通信中有一个 $firebase,它需要一些读取或写入规则,但是当添加新消息时如何获取事件
谢谢
【问题讨论】:
标签: angularjs firebase angularfire firebase-security