From b7a1eab9251105ce98ea0258d7e98c20c2808368 Mon Sep 17 00:00:00 2001 From: nmemmert <67961292+nmemmert@users.noreply.github.com> Date: Thu, 23 Oct 2025 08:44:28 -0400 Subject: [PATCH] Add Firestore rules for sharedPrayers collection to enable community sharing functionality --- firestore.rules | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/firestore.rules b/firestore.rules index c249c17..a3ef78d 100644 --- a/firestore.rules +++ b/firestore.rules @@ -29,9 +29,12 @@ service cloud.firestore { allow read, write: if request.auth != null; } - // Allow anyone to read public data (if needed in future) - match /public/{document} { - allow read: if true; + // Allow authenticated users to read/write shared prayers + match /sharedPrayers/{prayerId} { + allow read: if true; // Anyone can read shared prayers + allow create: if request.auth != null; // Only authenticated users can share + allow write: if request.auth != null && + request.auth.uid == resource.data.userId; // Only the original sharer can update } } } \ No newline at end of file