From c8a4afb839a15f1dee1bf304b8110abfda815b53 Mon Sep 17 00:00:00 2001 From: meganr Date: Sun, 12 Nov 2017 21:43:29 -0800 Subject: [PATCH] updating rules --- database.rules.json | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/database.rules.json b/database.rules.json index 40f44b5..cecbced 100644 --- a/database.rules.json +++ b/database.rules.json @@ -54,6 +54,15 @@ "$townHallID": { ".validate": "newData.hasChildren(['Member','eventId'])" } + }, + "state_legislators_user_submission" : { + "$state":{ + ".read": "true", + ".write": "auth.uid !== null", + "$townHallID": { + ".validate": "newData.hasChildren(['Member','eventId'])" + } + } }, "MOCs" : { ".read": "true", @@ -84,6 +93,29 @@ "$mocKey": { ".write": "root.child('users').child(auth.uid).child('isAdmin').val() == true" } + }, + "state_legislators_data" : { + ".read": "true", + "$state": { + ".read": "true", + ".write": "root.child('users').child(auth.uid).child('isAdmin').val() == true || root.child('users').child(auth.uid).child('dataIntern').val() == true", + "lastUpdatedBy": { + ".write": "auth.uid !== null" + }, + "lastUpdated": { + ".write": "auth.uid !== null" + }, + "currentEvents" : { + ".write": "auth.uid !== null" + } + } + }, + "state_legislators_id" : { + ".read": "true", + "$state": { + ".read": "true", + ".write": "root.child('users').child(auth.uid).child('isAdmin').val() == true" + } }, "mocByStateDistrict" : { ".read": "true",