These are my security rules regarding the users node in my database.
"users": {
"$uid": {
".read": "auth != null && $uid === auth.uid",
"$user_nodes": {
".write": "(auth != null && $uid === auth.uid) || (auth == null && $user_nodes.contains('connection'))"
}
}
}
With these rules when I am authenticated and try to read the whole information under my auth.uid everything works. For some reason though set operations are not allowed for the whole node, but update operations are. Can someone clearify to me why this is so?
EDIT: So in code a read operation would look something like this:
userRef.child(auth.getCurrentUser().getUid()).addListenerForSingleValueEvent(new ValueEventListener() {...});
A set operation would look something like this:
userRef.child(auth.getCurrentUser().getUid()).setValue(...);
I cannot show you exact code because the behaviour I explained above I actually experienced when testing the rules in the rules playground.