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

  1. 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).

  2. 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 / will fail because your customer is not allowed to read all of the data in that location, though you some have the same type of data there, in the same way as writing a location Treats with, and requires full permission before your operation is released.

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

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -