Created
September 26, 2017 20:58
-
-
Save ThadeuLuz/13f5c1e582b4d71fd6be74e31a534b18 to your computer and use it in GitHub Desktop.
A better stack for your Firebase Rules - Compiled Rules
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": { | |
"users": { | |
".read": "auth != null && auth.uid == 'SERVER'", | |
"$userId": { | |
".validate": "newData.hasChildren(['displayName', 'age'])", | |
"displayName": { | |
".validate": "newData.isString()" | |
}, | |
"age": { | |
".validate": "newData.isNumber()" | |
}, | |
"$other": { | |
".validate": "false" | |
}, | |
".read": "auth != null && auth.uid == $userId", | |
".write": "auth != null && auth.uid == $userId || auth != null && auth.uid == 'SERVER'" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment