0

I have a Firebase DB in which I store a list of user records. I want to secure the read and write access to this DB. I have created another set of users(named admin) which have very limited number of entries.

Is it possible in the Firebase security rules to just provide read and write access to the 1st list?

For example, if I want to provide access to admins with id 1 and 2, then provide something like :

"rules": {
        "users": {
          "$user": {
            ".read": <admin id 1,2>
          }
        }
    }
Sagar
  • 229
  • 4
  • 14
  • I have trouble understanding your question. Can you show a small snippet of sample data? You can probably get it from your Firebase with a URL like: `https://my.firebaseio.com/users.json?print=pretty` and trim it to be minimal and not expose confidential information. – Frank van Puffelen Jul 19 '15 at 16:56
  • 2
    Check out this answer: http://stackoverflow.com/questions/21815229/is-there-a-way-to-restrict-registrations-in-firebase/21834842#21834842 – André Kool Jul 19 '15 at 19:08
  • @AndréKool Thanks for the link,, I have been able to set up rules along similar lines and make this work. My other question is, if I have to do this validation through a node.js app, then how should I pass this auth token? I tried adding auth={ id: 42, provider: 'anonymous', uid: 'simplelogin:27' } as a query param, but it always throws Could not parse auth token.. – Sagar Jul 20 '15 at 16:33

0 Answers0