1

I have user profile $profileId in firebase with fields

 email
 name
 ratings
 type
 uid

I want to get access for all public users to read profile data except email. I tried this

"$profileId": {
        ".indexOn": ".value",
        ".read": true,
        "email": {
          ".read": "auth.uid == $profileId"
        }
      }

But all fields are public in this case. How I can hide email field without changing db structure?

Thanks

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
WhatIsHTML
  • 548
  • 1
  • 7
  • 19
  • 1
    Once a node is accessible (read or write) to a user, you cannot take that permission away on a lower level. You cannot use security rules to filter (or selectively expose) data. This has been covered *a lot* here under its moniker ["rules are not filters"](http://stackoverflow.com/search?q=%5Bfirebase%5D+rules+are+not+filters). I'll mark as a duplicate as one of those. – Frank van Puffelen Jan 27 '17 at 12:33

0 Answers0