If you want users to have read access to the whole /users branch but write only to his own user data you might be interested in doing the following:
{
“rules”: {
“users”: {
“.read”: “auth != null”,
“$user_id”: {
“.write”: “auth.uid === $user_id”
}
}
}
}
If you want the user to only see his own user then you should be using $firebaseObject(ref.child(userId)) instead of $firebaseArray. And working with your rules like the following:
Ok, I’ll make one more fresh Firebase project and see.
For this set of rules
The store value block has to be like this one?
So all the data is under the tag “users” and each users writes and read inside their own UID’s tag. Is that correct?
Well, fresh Firebase project made and connected to the app. With this set of rules:
the error message “This client does not have permission to perform this operation” appears if the app is open when the rules are changed. If the app opens after setting the rules the message is “Permission denied” just at the beggining.
With the rules set both to true, no problem, everything works fine.
I left here the aia and the apk.
I’m desperate. pruebaFirebase.aia (5.0 KB) pruebaFirebase.apk (6.8 MB)
I made my app work too with the token solution, but in the new Firebase project, in the old one, with the same configuration didn’t work. The old FB project’s servers are in Europe and the new one in USA, maybe the problem is there.
Thanks for all your help!
Yes, that that token I’d only will become as firebase token then only firebase rule will work/Can be applicable… We have to get it whenevr user sign-up/login
My app works perfectly for a while after fresh install of apk or after deleting app data and logging in . After stove time it automatically stats giving me permission denied notice.
I have read like 20 or 30 topics and tried everything. I’m sure that the app is logged in when this notice shows. Any help?
#off-topic
Dont share the video which are not in english… Already one post was hidden by the mod. Again and again sharing such videos mean there may be the chance for mute/suspending the account…
The app works perfectly when I freshly install it or when I delete all data and login again. It stops working of I open the app after a while like say overnight.
Its a very wierd problem.
But the problem is related to FB? Which is the error message? Maybe It has to be with the initialize screen block, but we need to know more so we can try to help.
I also try anyway, when I install the application from 0 and the user logs in, it works perfect, the problem is when the user changes the application and an hour passes (the token expires) and when he re-enters the application I get the Firebase permission denied error. I have tried to refresh the token (which it does correctly) but the error still appears, I don’t know what else to do. it’s a firebase bug