Skip to content

Instantly share code, notes, and snippets.

@pankajpatel
Created May 9, 2015 20:19
Show Gist options
  • Save pankajpatel/e811cabe0b31c83746af to your computer and use it in GitHub Desktop.
Save pankajpatel/e811cabe0b31c83746af to your computer and use it in GitHub Desktop.
Firebase Security Rules
{
"rules": {
"profiles": {
"$uid": {
// grants write access to the owner of this user account whose uid must exactly match the key ($uid)
".write": "auth !== null && auth.uid === $uid",
// grants read access to any user who is logged in with an email and password
".read": "auth !== null && auth.provider === 'password'"
}
},
"conatcts":{
"$uid": {
// grants write access to the owner of this user account whose uid must exactly match the key ($uid)
".write": "auth !== null && auth.uid === $uid",
// grants read access to any user who is logged in with an email and password
".read": "auth !== null && auth.provider === 'password'"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment