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