Skip to content

Instantly share code, notes, and snippets.

@rockwotj
Last active January 9, 2016 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rockwotj/084ada5250600b4ba939 to your computer and use it in GitHub Desktop.
Save rockwotj/084ada5250600b4ba939 to your computer and use it in GitHub Desktop.
Firebase bolt rules for the Moviequotes App
path /quotes {
write() = true;
read() = true;
}
path /quotes/$moviequote is Moviequote;
type Moviequote {
movie: String,
quote: String
}
{
"rules": {
"quotes": {
".read": "true",
".write": "true",
"$moviequote": {
".validate": "newData.hasChildren(['movie', 'quote'])",
"movie": {
".validate": "newData.isString()"
},
"quote": {
".validate": "newData.isString()"
},
"$other": {
".validate": "false"
}
}
}
}
}
@rockwotj
Copy link
Author

rockwotj commented Jan 9, 2016

Generated by the following command

firebase-bolt < moviequote-rules.bolt > moviequote-rules.generated.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment