Created
September 27, 2017 11:49
-
-
Save ThadeuLuz/e8b298f2aae08412bf855dceebcabe3f to your computer and use it in GitHub Desktop.
A better stack for your Firebase Rules - Targaryen tests
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
{ | |
"root": { | |
"users": { | |
"RICK": { | |
"displayName": "Rick Sanchez", | |
"age": 60 | |
}, | |
"MORTY": { | |
"displayName": "Morty Smith", | |
"age": 14 | |
} | |
} | |
}, | |
"users": { | |
"Rick": { "uid": "RICK" }, | |
"Morty": { "uid": "MORTY" }, | |
"Server": { "uid": "SERVER" } | |
}, | |
"tests": { | |
"users": { | |
"canRead": ["Server"], | |
"cannotRead": ["Rick", "Morty"] | |
}, | |
"users/MORTY": { | |
"canRead": ["Server", "Morty"], | |
"cannotRead": ["Rick"] | |
}, | |
"users/RICK/age": { | |
"canWrite": [{ "auth": "Rick", "data": 59 }] | |
}, | |
"users/RICK/displayName": { | |
"canWrite": [{ "auth": "Rick", "data": "Pickle Rick" }], | |
"cannotWrite": [ | |
{ "auth": "Rick", "data": null }, | |
{ "auth": "Rick", "data": 123 }, | |
{ "auth": "Rick", "data": { "no": "object" } } | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment