Last active
January 7, 2017 23:55
Firebase db rules for social app with profiles and posts
This file contains hidden or 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