-4
我在firebase中有以下數據結構,是否有使用firebase規則停止讀取如果用戶UID在塊節點/列表中。 enter image description here被阻止的用戶的Firebase規則
我在firebase中有以下數據結構,是否有使用firebase規則停止讀取如果用戶UID在塊節點/列表中。 enter image description here被阻止的用戶的Firebase規則
@jay感謝您的回覆,這是我的firebase結構和firebase規則。
{
"rules": {
".write": "auth != null",
".read": "auth != null",
\t \t "accounts": {
".read": true,
\t ".indexOn": ["username"]
\t },
\t \t "requests": {
\t ".read": true,
\t ".write": "auth != null"
\t }
}
}
{
"accounts" : {
"2aVaHeIsTpbZYq7eXHG2nM3lUu53" : {
"dateCreated" : "Fri Apr 14 2017 12:23:21 GMT+0100 (BST)",
"description" : "Hello! I am a new FireLine user.",
"email" : "[email protected]",
"img" : "https://",
"name" : "Firebase User",
"provider" : "Firebase",
"userId" : "2aVaHeIsTpbZYq7eXHG2nM3lUu53",
"username" : "FirebaseUser2aVaHeIs"
},
"OCXMwQVzr4NMXIJNj73fOankChr1" : {
"conversations" : {
"VhPhN8e2NRYdrzMqUv9x5a2WzrJ2" : {
"conversationId" : "-KdvS_lEyIyW52ekSZPD",
"messagesRead" : 6
}
},
"dateCreated" : "Fri Feb 24 2017 14:23:48 GMT+0000 (GMT Standard Time)",
"description" : "Þþttttttkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk",
"email" : "[email protected]",
"friends" : [ "VhPhN8e2NRYdrzMqUv9x5a2WzrJ2" ],
"groups" : {
"-KdvemO-UxsMkhiaWogL" : {
"messagesRead" : 7
}
},
"blocks" : {
"VhPhN8e2NRYdrzMqUv9x5a2WzrJ2" : {
"OCXMwQVzr4NMXIJNj73fOankChr1" : true
}
},
"conversations" : {
"-KdvS_lEyIyW52ekSZPD" : {
"dateCreated" : "Sun Feb 26 2017 17:27:18 GMT+0000 (GMT)",
"messages" : [ {
"avatar" : "https://",
"date" : "Sun Feb 26 2017 17:27:18 GMT+0000 (GMT)",
"message" : "hhh",
"sender" : "OCXMwQVzr4NMXIJNj73fOankChr1",
"type" : "text"
}, {
"avatar" : "https://",
"date" : "Sun Feb 26 2017 18:09:45 GMT+0000 (GMT Standard Time)",
"message" : "hhhhh",
"sender" : "OCXMwQVzr4NMXIJNj73fOankChr1",
"type" : "text"
}
},
"groups" : {
"-KdvemO-UxsMkhiaWogL" : {
"dateCreated" : "Sun Feb 26 2017 18:24:58 GMT+0000 (GMT)",
"description" : "lllllllllllllllllllllllllllllllllllllllllll",
"img" : "https://",
"members" : [ "OCXMwQVzr4NMXIJNj73fOankChr1", "VhPhN8e2NRYdrzMqUv9x5a2WzrJ2", "sdfsdfsdf" ],
"messages" : [ {
"avatar" : "https://",
"date" : "Sun Feb 26 2017 18:24:58 GMT+0000 (GMT)",
"icon" : "md-chatbubbles",
"message" : "This group has been created.",
"sender" : "OCXMwQVzr4NMXIJNj73fOankChr1",
"type" : "system"
}, {
"avatar" : "assets/images/profile.png",
"date" : "Tue Apr 11 2017 22:34:59 GMT+0100 (GMT Daylight Time)",
"icon" : "md-create",
"message" : "Firebase User has changed the group name to: yest.",
"sender" : "VhPhN8e2NRYdrzMqUv9x5a2WzrJ2",
"type" : "system"
}
},
"likes" : {
"OCXMwQVzr4NMXIJNj73fOankChr1" : {
"-Kh3tVr2tdf2tsDoFj2e" : {
"liked" : true
},
"-Kh3tWl6EDHM8SN-oKXv" : {
"liked" : true
},
"VhPhN8e2NRYdrzMqUv9x5a2WzrJ2" : {
"-Kh3tXaDvavmQCZ3gIyN" : {
"liked" : true
},
"-Kh3tYEsRK0dDHlkNaKD" : {
"liked" : true
}
},
"wallposts" : {
"-Kh3tVr2tdf2tsDoFj2e" : {
"date" : "Thu Apr 06 2017 21:12:58 GMT+0100 (GMT Daylight Time)",
"message" : "fgdfgdgdfgdfg",
"sender" : "OCXMwQVzr4NMXIJNj73fOankChr1",
"type" : "text"
},
"-Kh3tWl6EDHM8SN-oKXv" : {
"date" : "Thu Apr 06 2017 21:13:02 GMT+0100 (GMT Daylight Time)",
"message" : "dfgdfgdfgdfgdfg",
"sender" : "OCXMwQVzr4NMXIJNj73fOankChr1",
"type" : "text"
}
}
}
請發表您的規則和火力結構,在你的問題,沒有圖像或鏈接文字。鏈接中斷。您可以通過Firebase控制檯 - >右側的三個點 - >導出JSON獲取您的結構。 – Jay
@jay謝謝,我粘貼下面的規則和結構 – Emirbi
請更新您的*問題*的信息,請不要將其添加爲答案。如果你將它作爲答案,它將被刪除。請回顧[我如何問一個好問題?](http://stackoverflow.com/help/how-to-ask),最重要的是[如何創建一個最小,完整和可驗證的例子](http:// stackoverflow.com/help/mcve) – Jay