Add Firestore rules for sharedPrayers collection to enable community sharing functionality
This commit is contained in:
1 parent
39d621a0be
commit
b7a1eab925
1 file changed
+6
-3
+6
-3
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user