工作何時使用.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 –