Skip to content

Instantly share code, notes, and snippets.

@bezysoftware
Created June 12, 2017 08:16
Show Gist options
  • Select an option

  • Save bezysoftware/47ad701fb34bed6f4263a8dd51be14b5 to your computer and use it in GitHub Desktop.

Select an option

Save bezysoftware/47ad701fb34bed6f4263a8dd51be14b5 to your computer and use it in GitHub Desktop.
"members": {
"$group_id": {
"$member_id": {
".validate": "newData.hasChildren(['active', 'defaultWeight', 'name'])",
"active": {
".validate": "newData.isBoolean()"
},
"bankAccount": {
".validate": "newData.isString() && (newData.val().length > 0 && newData.val().length <= 24)"
},
"defaultWeight": {
".validate": "newData.isString() && (newData.val().length > 0 && newData.val().length <= 40)"
},
"migrated": {
".validate": "newData.isBoolean()"
},
"name": {
".validate": "newData.isString() && (newData.val().length > 0 && newData.val().length <= 20)"
},
"photoUrl": {
".validate": "newData.isString() && (newData.val().length > 0 && newData.val().length <= 300)"
},
"$other": {
".validate": "false"
}
},
".read": "root.child('permissions').child($group_id).child(auth.uid).child('level').val() >= 10",
".write": "root.child('permissions').child($group_id).child(auth.uid).child('level').val() >= 20",
".indexOn": [
"name"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment