我的規則是這樣的 -做認證
{
"rules": {
"customer": {
"$user_id": {
".write": false,
".read" : "$user_id === auth.uid"
}
},
"franchises":
{
".read": true,
".write": "root.child('customer').hasChild(newData.child('salon_id').val())"
}
}
}
我想在加盟店這是有一個salon_id添加數據,我要確保這salon_id在客戶存在 as uid。
我收到錯誤
PERMISSION_DENIED:權限被拒絕
的代碼編輯 -
var ref = firebase.database().ref('franchises');
ref.push({
address: address,
contact_no: contact_no,
contact_person_name: contact_person_name,
name: textinputPlaceName,
salon_id: salon_id
});
沒有看到導致此錯誤消息的最小代碼,它很難提供幫助。 –
我應該發佈什麼數據結構? – Anirban
當您執行某段代碼時,您包含的錯誤消息會被觸發。您需要在問題中包含觸發問題的最小代碼。 –