Skip to content

Commit

Permalink
feat(database-general): update rules
Browse files Browse the repository at this point in the history
  • Loading branch information
albertodigioacchino committed Jan 28, 2021
1 parent 8a0bad6 commit 36a5c16
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions packages/database/database.rules.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
{
"rules": {
".read": true,
".write": true
"statuses": {
"$uid": {
".read": "auth !== null",
".write": "auth.uid === $uid"
}
},
"games": {
"$gameId": {
".read": "auth !== null && root.child('statuses').child(auth.uid).child('state').val() === 'online'",
".write": false
}
},
"cards": {
"$gameId": {
"$cardId": {
".indexOn": [
"lockedBy"
]
}
}
}
}
}

0 comments on commit 36a5c16

Please sign in to comment.