From 47372b2ffd81bf68739737ced95a678c58dd8972 Mon Sep 17 00:00:00 2001 From: Nisala Date: Mon, 22 Jul 2024 13:09:54 -0700 Subject: [PATCH] Update security rules --- database.rules.json | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/database.rules.json b/database.rules.json index bce0aaff..4af09b78 100644 --- a/database.rules.json +++ b/database.rules.json @@ -6,9 +6,6 @@ ".read": true, ".write": false }, - "beginnerQuestions": { - ".read": true - }, "$uid": { "logs": { ".read": "auth != null && auth.uid == $uid" @@ -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" + } } } } -} \ No newline at end of file +}