工作何时使用.read
与用户节点上的真正的规则火力地堡规则,我给访问一些身份验证的用户阅读上树中列出的每个用户。那我只需要一些。,像一个过滤器
我需要一些规则,就像一个过滤器。因此,在获取用户/路径时,此已认证的用户将获得一个的用户数组,只有的用户拥有像$uid > permission > auth.uid = true
这样的权限路径。
{
"rules": {
"Users" : {
".read": true,
"$uid" : {
".read" : "(auth != null && auth.uid === $uid) || root.child('Users/'+ $uid+'/permission/'+ auth.uid).val() == true",
".write" : false
}
},
}
}
见http://stackoverflow.com/questions/14296625/restricting-child-field-access-with-security-rules –