Skip to content

Commit

Permalink
Update security rules
Browse files Browse the repository at this point in the history
  • Loading branch information
nkalupahana authored Jul 22, 2024
1 parent f8fc7b3 commit 47372b2
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions database.rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
".read": true,
".write": false
},
"beginnerQuestions": {
".read": true
},
"$uid": {
"logs": {
".read": "auth != null && auth.uid == $uid"
Expand Down Expand Up @@ -44,20 +41,27 @@
".read": "auth != null && auth.uid == $uid"
},
"onboarding": {
".read": true,
".read": "auth != null && auth.uid == $uid",
"beginner": {
".write": true,
".write": "auth != null && auth.uid == $uid",
".validate": "(newData.isNumber() && newData.val() == now) || newData.val() == false"
},
"questions": {
".write": true,
".write": "auth != null && auth.uid == $uid",
".validate": "newData.isBoolean()"
},
"onboarded": {
".write": true,
".write": "auth != null && auth.uid == $uid",
".validate": "newData.isBoolean() && newData.val() == true"
}
},
"prompts": {
".read": "auth != null && auth.uid == $uid",
"streak": {
".write": "auth != null && auth.uid == $uid",
".validate": "newData.isNumber() && newData.val() > 0"
}
}
}
}
}
}

0 comments on commit 47372b2

Please sign in to comment.