jaswanth03
2/5/2018 - 10:34 AM

Firebase Rules


//firebase default rule it will work only when a user authenticates using firebase
{
  "rules": {
    ".read": "auth != null",
    ".write": "auth != null"
  }
}

// for people who are not using the auth function in firebase.
{
  "rules": {
    ".read": "auth == null",
    ".write": "auth == null"
  }
}


//this is not preferred but it will not check any thing whether a user is auth or not.
{
  "rules": {
    ".read":true,
    ".write": true
  }
}

// These rules grant access to a node matching the authenticated
// user's ID from the Firebase auth token
{
  "rules": {
    "users": {
      "$uid": {
        ".read": "$uid === auth.uid",
        ".write": "$uid === auth.uid"
      }
    }
  }
}

// These rules don't allow anyone read or write access to your database
{
  "rules": {
    ".read": false,
    ".write": false
  }
}