From 18376f8a3f5335ae018160a641c110e46c6c94b4 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Wed, 16 Feb 2022 22:12:52 -0600 Subject: [PATCH] Consolidate firestore rules for subcollections --- firestore.rules | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/firestore.rules b/firestore.rules index a48e23c9..a626ce1f 100644 --- a/firestore.rules +++ b/firestore.rules @@ -27,25 +27,13 @@ service cloud.firestore { allow delete: if resource.data.creatorId == request.auth.uid; } - match /contracts/{contractId}/bets/{betId} { - allow read; - } - match /{somePath=**}/bets/{betId} { allow read; } - match /contracts/{contractId}/comments/{commentId} { - allow read; - allow create: if request.auth != null; - } - match /{somePath=**}/comments/{commentId} { allow read; - } - - match /contracts/{contractId}/answers/{answerId} { - allow read; + allow create: if request.auth != null; } match /{somePath=**}/answers/{answerId} { @@ -57,13 +45,9 @@ service cloud.firestore { allow update, delete: if request.auth.uid == resource.data.curatorId; } - match /folds/{foldId}/followers/{userId} { + match /{somePath=**}/followers/{userId} { allow read; allow write: if request.auth.uid == userId; } - - match /{somePath=**}/followers/{userId} { - allow read; - } } } \ No newline at end of file