angularjs - Purposefully not returning child values when retrieving a Firebase object -
I have a user
object in Firebase db, in which some sensitive date (e.g., email).
For situations where I need to get user information (which are not current users), how do I stop this data from returning? (For example, if the user can see other user's profile data.)
Options
-
Using Firebase : The option with this problem is that there are tons of errors throwing while trying to recover the user object (even if I want to hide sensitive child values under that user object).
-
My data is so that public and private data are in two separate ways
Option # 2 makes me viable It seems, but I want to see before making a major architectural overhaul that there is no easy solution?
Regarding security rules, the Firebase action is not all-or-nothing.
As a result, all attempt to load / users /
To handle this use, consider restructuring your data like this:
{"rule": {".read": wrong, ".write": Wrong, "user": {"$ uid": {// Users can read / write all their data ".write": "Auth! = Null & auth.uid == $ Uid "public: {// public data here" .read ": true // make all this data public}," private ": {/ / personal data goes here}}}}}
< / Pre>
Comments
Post a Comment