W
W
wintermoon2016-11-01 18:51:05
firebase
wintermoon, 2016-11-01 18:51:05

How to create admin user etc in firebase?

I don’t quite understand how to make users with different rights, here are the rules:

{
  "rules": {
    "authentication": {
      "users": {
        "$uid": {
          ".read": "auth.uid == $uid || root.child('authentication').child('users').child('auth.uid').child('isAdmin').val() == true",
          ".write": "newData.parent().parent().parent().child('authentication').child('users').child('auth.uid').child('isAdmin').val() == true",
          ".indexOn": [
            "email"
          ]
        }
      }
   }
 }
}

User:
prntscr.com/d1qg4k
Base:
prntscr.com/d1qh51
Are there any examples?)
Thank you!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question