Last active
January 7, 2017 23:55
-
-
Save heloa-net/68bed8db34cc89f5db3fc8d6c7f9655d to your computer and use it in GitHub Desktop.
Firebase db rules for social app with profiles and posts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"rules": { | |
".read": true, | |
"profiles": { | |
"$user_id": { | |
".read": true, | |
".write": "$user_id === auth.uid" | |
} | |
}, | |
"posts": { | |
"$post": { | |
".read": true, | |
".write": "!data.exists() && newData.child('userId').val() === auth.uid" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment