2
I’m developing an app with Ionic 3 and the Firebase ... In the rules of Realtime Database, the problem arises: I try to put the rules pro type "user", but the following error arises :
ERROR Error: Uncaught (in Promise): Error: PERMISSION_DENIED: Permission denied
ERROR Error: permission_denied at /orders: Client doesn’t have permission to access the desired data.
Rule structure :
{
"rules": {
"users": {
"$uid": {
".read": "$uid === auth.uid",
".write": "$uid === auth.uid"
}
}
}
}
Where is /requests in the database?
– Lennoard Silva
{ "requests" { "-Lmmaryymarcdemmdpjm" { "name" : "ASDASD", "tel" : "23" }, "-Lmnvv3syodnsdkuktjo" : { "name" : "asdasd", "tel" : "23" }, "-Lmnw4kkrruojaof1i3p" : { "name" : "asdasd", "tel" : "231" }, "-Lmqitihar-Vumkpq8fd" { "name" : "asdasdsa", "tel" : "213" }, "-Lmqjg75q0ajgr_3dhxg" : { "name" : "asdsad", "tel" "123" } } } } }
– user125721
So it’s at the root as well as users? (Post relevant data formatted in the question)
– Lennoard Silva
How should the right structure be for my database ? I need only the user to read and write their requests. Would that be the way ?? : { "Rules": { "users": { "requests": { "$uid": { ". read": "$uid === auth.uid", ". write": "$uid === auth.uid" } } } } }
– user125721